Browse Source

产品搜索只保留搜索名称

gorden 5 tháng trước cách đây
mục cha
commit
539673cf2c
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      app/admin/service/goods/GoodsService.php

+ 2 - 2
app/admin/service/goods/GoodsService.php

@@ -219,8 +219,8 @@ class GoodsService
         $total = Goods::leftJoin('goods_running', 'goods_running.join_running_goods_id', '=', 'goods.goods_id')
             ->when($goodsName != '', function ($query) use ($goodsName) {
                 $query->where(function ($q) use ($goodsName) {
-                    $q->where('goods_name', 'like', '%' . $goodsName . '%')
-                        ->OrWhere('goods_title', 'like', '%' . $goodsName . '%');
+                    $q->where('goods_name', 'like', '%' . $goodsName . '%');
+//                        ->OrWhere('goods_title', 'like', '%' . $goodsName . '%');
                 });
             })->when($categoryId != null, function ($query) use ($categoryId) {
                 $query->whereIn('join_goods_category_id', $categoryId);