refactor: 修改视频分类列表接口

This commit is contained in:
2025-03-28 16:47:04 +08:00
parent 24123f2490
commit 2d3964f5c4
2 changed files with 7 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ class VideoCategory
'name' => $param['name']??null 'name' => $param['name']??null
]) ])
->language(request()->lang_id) ->language(request()->lang_id)
->isShow()
->order(['sort' => 'asc', 'id' => 'desc']) ->order(['sort' => 'asc', 'id' => 'desc'])
->select(); ->select();

View File

@@ -37,4 +37,10 @@ class VideoCategoryModel extends VideoCategoryBaseModel
{ {
$query->where('language_id', '=', $value); $query->where('language_id', '=', $value);
} }
// 显示状态查询
public function scopeIsShow($query, bool $value = true)
{
$query->where('is_show', '=', (int)$value);
}
} }