kphcdr hace 1 año
padre
commit
397266758e
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      app/Modules/Mini/Services/PageService.php

+ 6 - 1
app/Modules/Mini/Services/PageService.php

@@ -204,7 +204,12 @@ class PageService extends BaseService
             $query->whereIn("id", $goodsIdArr);
 
         })->when($params['keyword'], function (Builder $query) use ($params) {
-            $query->where("name", "like", "%" . $params['keyword'] . "%");
+            $query->where(function (Builder $query) use ($params) {
+                $query->where("name", "like", "%" . $params['keyword'] . "%")
+                    ->orWhere("custom", "like", "%" . $params['keyword'] . "%")
+                    ->orWhere("desc_html", "like", "%" . $params['keyword'] . "%")
+                    ->orWhereIn("id", GoodsSpecMap::where("value", "like", "%{$params['keyword']}%")->get(["goods_id"])->pluck("goods_id")->toArray());
+            });
         })->orderByDesc("weight")->paginate($pageSize);
 
         return [