登录
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?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 Categorie extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $connection = 'mysql';
|
||||
protected $table = 'tkt_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(CategorieTranslation::class, 'categorie_id')->where('locale', locale());
|
||||
}
|
||||
|
||||
/**
|
||||
* 多条翻译
|
||||
*/
|
||||
public function translations()
|
||||
{
|
||||
return $this->hasMany(CategorieTranslation::class, 'categorie_id');
|
||||
}
|
||||
|
||||
public function ticket(){
|
||||
return $this->hasOne(Ticket::class, 'categorie_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user