refacotr: 视频

This commit is contained in:
2025-04-15 18:07:42 +08:00
parent 90f1d3a881
commit f582a30478
4 changed files with 97 additions and 40 deletions

View File

@@ -3,12 +3,29 @@ declare (strict_types = 1);
namespace app\index\model;
use think\Model;
use app\common\model\VideoCategoryBaseModel;
use think\model\concern\SoftDelete;
/**
* 视频分类模型
* @mixin \think\Model
*/
class VideoCategoryModel extends Model
class VideoCategoryModel extends VideoCategoryBaseModel
{
//
// 启用软删除
use SoftDelete;
// 软删除字段
protected $deleteTime = 'deleted_at';
// 所属语言范围查询
public function scopeLanguage($query, $language)
{
$query->where('language_id', '=', $language);
}
// 是否显示状态范围查询
public function scopeIsShow($query, bool $is_show)
{
$query->where('is_show', '=', (int)$is_show);
}
}