refactor: 下载分类列表接口调整
This commit is contained in:
@@ -39,7 +39,7 @@ class AttachmentCategory
|
||||
'page' => $params['page']
|
||||
]);
|
||||
} else if ('all' == request()->param('scene')) {
|
||||
$categorys = $categorys->select()->hidden(['sort', 'is_show']);
|
||||
$categorys = $categorys->isShow()->select()->hidden(['sort', 'is_show']);
|
||||
}
|
||||
|
||||
return success('获取成功', $categorys);
|
||||
|
||||
@@ -28,4 +28,10 @@ class AttachmentCategoryModel extends AttachmentCategoryBaseModel
|
||||
{
|
||||
$query->where('language_id', '=', $value);
|
||||
}
|
||||
|
||||
// 查询显示状态数据
|
||||
public function scopeIsShow($query, bool $value = true)
|
||||
{
|
||||
$query->where('is_show', '=', (int)$value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user