Files
fdesk/app/ticket/model/TicketCategorie.php
T
2025-07-04 14:38:00 +08:00

50 lines
1.2 KiB
PHP

<?php
namespace app\ticket\model;
use Illuminate\Database\Eloquent\SoftDeletes;
use support\Model;
/**
* ticket_categorie 工单分类表
* @property integer $id 主键
* @property string $name 分类名称
* @property string $description 分类描述
* @property string $created_at 创建时间
* @property string $updated_at 更新时间
* @property string $deleted_at 删除时间
*/
class TicketCategorie extends Model
{
use SoftDeletes;
protected $connection = 'mysql';
protected $table = 'ticket_categorie';
protected $primaryKey = 'id';
public $timestamps = true;
protected $dateFormat = 'U';
protected $dates = ['created_at', 'updated_at'];
protected $casts = [
'updated_at' => 'datetime:Y-m-d H:i:s',
'created_at' => 'datetime:Y-m-d H:i:s',
];
protected $fillable = [
'name',
'description',
];
/**
* 单条翻译
*/
public function translation()
{
return $this->hasOne(TicketCategorieTranslation::class, 'categorie_id')->where('locale', locale());
}
/**
* 多条翻译
*/
public function translations()
{
return $this->hasMany(TicketCategorieTranslation::class, 'categorie_id');
}
}