refactor: 修改附件分类列表接口
This commit is contained in:
@@ -18,6 +18,7 @@ class AttachmentCategory
|
|||||||
{
|
{
|
||||||
$params = request()->param([
|
$params = request()->param([
|
||||||
'name',
|
'name',
|
||||||
|
'is_show',
|
||||||
'page/d' => 1,
|
'page/d' => 1,
|
||||||
'size/d' => 10
|
'size/d' => 10
|
||||||
]);
|
]);
|
||||||
@@ -39,7 +40,13 @@ class AttachmentCategory
|
|||||||
'page' => $params['page']
|
'page' => $params['page']
|
||||||
]);
|
]);
|
||||||
} else if ('all' == request()->param('scene')) {
|
} else if ('all' == request()->param('scene')) {
|
||||||
$categorys = $categorys->isShow()->select()->hidden(['sort', 'is_show']);
|
$categorys = $categorys->where(function($query) use($params) {
|
||||||
|
if (isset($params['is_show'])) {
|
||||||
|
$query->where('is_show', '=', $params['is_show']);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->select()
|
||||||
|
->hidden(['sort', 'is_show']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return success('获取成功', $categorys);
|
return success('获取成功', $categorys);
|
||||||
|
|||||||
Reference in New Issue
Block a user