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

This commit is contained in:
2025-03-31 14:03:34 +08:00
parent b57b89e3ff
commit ef75387390

View File

@@ -16,7 +16,10 @@ class VideoCategory
*/
public function list()
{
$param = request()->param(['name' => '']);
$param = request()->param([
'name' => '',
'is_show'
]);
$categorys = VideoCategoryModel::field([
'id',
'name',
@@ -25,7 +28,11 @@ class VideoCategory
'name' => $param['name']??null
])
->language(request()->lang_id)
->isShow()
->where(function($query) use($param) {
if (isset($param['is_show'])) {
$query->where('is_show', '=', $param['is_show']);
}
})
->order(['sort' => 'asc', 'id' => 'desc'])
->select();