kphcdr 1 year ago
parent
commit
d67473a884
1 changed files with 3 additions and 3 deletions
  1. 3 3
      app/Modules/Mini/Services/PageService.php

+ 3 - 3
app/Modules/Mini/Services/PageService.php

@@ -146,7 +146,7 @@ class PageService extends BaseService
             $mapQuery = GoodsSpecMap::query();
             foreach ($attrMap as $attr) {
                 $mapQuery->orWhere(function (Builder $query) use ($attr) {
-                    $query->where("spec_id", $attr['spec_id'])->Where("value", $attr['value']);
+                    $query->where("spec_id", $attr['spec_id'])->where("value", "like", "%{$attr['value']}%");
                 });
             }
             $goodsIdArr = $mapQuery->groupBy("goods_id")->having(DB::raw("count(`goods_id`)"), count($attrMap))->get("goods_id")->pluck("goods_id")->toArray();
@@ -183,7 +183,7 @@ class PageService extends BaseService
             $mapQuery = GoodsSpecMap::query();
             foreach ($attrMap as $attr) {
                 $mapQuery->orWhere(function (Builder $query) use ($attr) {
-                    $query->where("spec_id", $attr['spec_id'])->Where("value", $attr['value']);
+                    $query->where("spec_id", $attr['spec_id'])->where("value", "like", "%{$attr['value']}%");
                 });
             }
             $goodsIdArr = $mapQuery->groupBy("goods_id")->having(DB::raw("count(`goods_id`)"), count($attrMap))->get("goods_id")->pluck("goods_id")->toArray();
@@ -204,7 +204,7 @@ class PageService extends BaseService
                     "weight" => $model->weight,
                 ];
             }, $p->items()),
-            "category" => $this->searchCategory($params['keyword']),
+            "category" => [],
         ];
     }