shish 11 ヶ月 前
コミット
bd9e049e8c

+ 1 - 3
app-hd/controllers/CategoryController.php

@@ -140,9 +140,7 @@ class CategoryController extends BaseController
         $where['mainId'] = $this->mainId;
         $where['delStatus'] = 0;
         $searchText = $get['searchText'] ?? '';
-        if (!empty($searchText)) {
-            $where['name'] = ['like', $searchText];
-        }
+        $where['name'] = $searchText;
         if (!empty($catId)) {
             $where['cId'] = $catId;
         }

+ 1 - 1
app-mall/controllers/CategoryController.php

@@ -62,7 +62,7 @@ class CategoryController extends BaseController
         $where['delStatus'] = 0;//只获取非删除状态
         $where['status'] = 1;//上下架状态为1(正常)
         $searchText = $get['searchText'] ?? '';
-        $where['searchText'] = $searchText;
+        $where['name'] = $searchText;
         $shop = $this->shop;
         $custom = $this->custom;
         $params = [];

+ 2 - 2
biz-hd/goods/classes/GoodsCategoryClass.php

@@ -28,8 +28,8 @@ class GoodsCategoryClass extends BaseClass
         if (!empty($where['cId'])) {
             $query->andWhere(['xhGoodsCategory.cId' => $where['cId']]);
         }
-        if (!empty($where['searchText'])) {
-            $query->andWhere(['like', 'xhGoodsCategory.name', $where['searchText']]);
+        if (!empty($where['name'])) {
+            $query->andWhere(['like', 'xhGoodsCategory.name', $where['name']]);
         }
 
         $flowerNum = $params['flowerNum'] ?? -1;