feat: 新增产品分类用于下拉框场景列表树接口

This commit is contained in:
2025-03-28 16:57:23 +08:00
parent 7ec6f9861f
commit ae6a927d45
3 changed files with 19 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ class ProductCategory
public function index()
{
$params = request()->param([
'is_show',
'keywords' => '',
]);
@@ -30,8 +31,13 @@ class ProductCategory
])
->language(request()->lang_id)
->withSearch(['name_nullable'], [
'name_nullable' => $params['keywords']
'name_nullable' => $params['keywords']??null
])
->where(function($query) use($params) {
if (!empty($params['is_show'])) {
$query->where('is_show', '=', $params['is_show']);
}
})
->select();
if ($ret->isEmpty()) {
return success('获取成功');