工单列表

This commit is contained in:
2025-07-04 15:04:29 +08:00
parent b70fc6c4f8
commit 388747634a
7 changed files with 22 additions and 12 deletions
@@ -14,7 +14,7 @@ use support\Model;
* @property string $updated_at 更新时间
* @property string $deleted_at 删除时间
*/
class TicketCategorie extends Model
class Categorie extends Model
{
use SoftDeletes;
protected $connection = 'mysql';
@@ -37,7 +37,7 @@ class TicketCategorie extends Model
*/
public function translation()
{
return $this->hasOne(TicketCategorieTranslation::class, 'categorie_id')->where('locale', locale());
return $this->hasOne(CategorieTranslation::class, 'categorie_id')->where('locale', locale());
}
/**
@@ -45,6 +45,10 @@ class TicketCategorie extends Model
*/
public function translations()
{
return $this->hasMany(TicketCategorieTranslation::class, 'categorie_id');
return $this->hasMany(CategorieTranslation::class, 'categorie_id');
}
public function ticket(){
return $this->hasOne(Ticket::class, 'categorie_id', 'id');
}
}
@@ -14,7 +14,7 @@ use support\Model;
* @property string $created_at 创建时间
* @property string $updated_at 更新时间
*/
class TicketCategorieTranslation extends Model
class CategorieTranslation extends Model
{
protected $connection = 'mysql';
protected $table = 'ticket_categorie_translation';
+4
View File
@@ -70,4 +70,8 @@ class Ticket extends Model
public function attachments(){
return $this->hasMany(Attachment::class, 'ticket_id', 'id');
}
public function categorie(){
return $this->belongsTo(Categorie::class, 'categorie_id', 'id');
}
}