refactor: 视频信息分类添加软件删除

This commit is contained in:
2025-02-21 15:35:51 +08:00
parent af9ab0f4ab
commit 8a5b1bdaa7
3 changed files with 10 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ declare (strict_types = 1);
namespace app\admin\model\v1;
use app\common\model\VideoCategoryBaseModel;
use think\model\concern\SoftDelete;
/**
* 视频分类模型
@@ -11,6 +12,13 @@ use app\common\model\VideoCategoryBaseModel;
*/
class VideoCategoryModel extends VideoCategoryBaseModel
{
// 启用软件删除
use SoftDelete;
// 软删除字段
protected $deleteTime = 'deleted_at';
// 自动写入时间格式
protected $autoWriteTimestamp = 'datetime';
// 关联视频模型
public function video()
{

View File

@@ -24,5 +24,6 @@ class VideoCategoryBaseModel extends BaseModel
'is_show' => 'int',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
];
}