refactor: 修改视频分类列表接口
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user