refactor: 修改视频分类列表接口
This commit is contained in:
@@ -16,7 +16,10 @@ class VideoCategory
|
|||||||
*/
|
*/
|
||||||
public function list()
|
public function list()
|
||||||
{
|
{
|
||||||
$param = request()->param(['name' => '']);
|
$param = request()->param([
|
||||||
|
'name' => '',
|
||||||
|
'is_show'
|
||||||
|
]);
|
||||||
$categorys = VideoCategoryModel::field([
|
$categorys = VideoCategoryModel::field([
|
||||||
'id',
|
'id',
|
||||||
'name',
|
'name',
|
||||||
@@ -25,7 +28,11 @@ class VideoCategory
|
|||||||
'name' => $param['name']??null
|
'name' => $param['name']??null
|
||||||
])
|
])
|
||||||
->language(request()->lang_id)
|
->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'])
|
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user