Files
fdesk/app/ticket/model/Ticket.php
T
2025-07-11 18:01:23 +08:00

78 lines
1.6 KiB
PHP

<?php
namespace app\ticket\model;
use app\common\model\Resource;
use app\common\model\Role;
use app\common\model\Systems;
use support\Model;
/**
* users 用户表
* @property integer $id 用户ID(主键)
* @property string $code 工单编号
* @property string $categorie_id 分类id
* @property string $content 内容
* @property string $sort 排序
* @property integer $status 状态
* @property string $user_id 创建人id
* @property string $created_at
* @property string $updated_at
*/
class Ticket extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'tkt_ticket';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
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 = [
'code',
'categorie_id',
'content',
'sort',
'status',
'user_id'
];
public function attachments(){
return $this->hasMany(Attachment::class, 'ticket_id', 'id');
}
public function categorie(){
return $this->belongsTo(Categorie::class, 'categorie_id', 'id');
}
}