kphcdr 1 năm trước cách đây
mục cha
commit
d3646aa6f0

+ 0 - 22
app/Modules/Mini/Controllers/GoodsController.php

@@ -31,28 +31,6 @@ class GoodsController extends BaseController
         return $this->ok($this->service->info($params));
     }
 
-    public function search()
-    {
-        return $this->ok([
-            "total" => 1,
-            "page_total" => 1,
-            "list" => [
-                [
-                    "id" => 1,
-                    "name" => "商品名称",
-                    "thumb" => Image::imageUrl(),
-                ],
-            ],
-            "category" => [
-                [
-                    "id" => 1,
-                    "thumb" => Image::imageUrl(),
-                    "name" => "分类名称",
-                ],
-            ],
-        ]);
-    }
-
     public function fav()
     {
         $params = $this->valid([

+ 1 - 1
app/Modules/Mini/Services/GoodsService.php

@@ -24,7 +24,7 @@ class GoodsService extends BaseService
         return [
             "id" => $goods->id,
             "name" => $goods->name,
-            "category_name" => $goods->map->map(function (GoodsCategoryMap $map) {
+            "category_name" => $goods->map->where("is_public", 1)->map(function (GoodsCategoryMap $map) {
                 return optional($map->category)->name;
             })->implode("/"),
             "image_list" => $goods->image_list,