商品搜索添加商品分类搜索

This commit is contained in:
wangxiaowei 2024-12-16 16:27:09 +08:00
parent 76dbf143aa
commit 1b2e37735f

@ -518,7 +518,7 @@ class GoodsLogic extends Logic
// dump($wh);
// dump($where);
// dump($order);die;
$whereIn = '';
$cate = [];
if (isset($get['keyword'])) {
$cate = GoodsCategory::where(['is_show' => 1, 'del' => 0])
->where([['name', 'like', '%' . trim($get['keyword']) . '%']])
@ -527,7 +527,7 @@ class GoodsLogic extends Logic
->toArray();
}
if ($cate) {
if (!empty($cate)) {
$where = array_filter($where, function($item) {
return $item[0] !== "name";
});