Gorden 9 ay önce
ebeveyn
işleme
58b7e94a9a
1 değiştirilmiş dosya ile 6 ekleme ve 6 silme
  1. 6 6
      app/admin/service/goods/GoodsService.php

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

@@ -178,10 +178,10 @@ class GoodsService
             })->when($goodsCategory != null, function ($query) use ($goodsCategory) {
                 $query->where('goods_category', $goodsCategory);
             })
-            ->when($classify != '', function ($query) use ($classify) {
-                if ($classify == 'GOODS') {
+            ->when($classify != '', function ($query) use ($classify,$categoryId) {
+                if ($classify == 'GOODS' && empty($categoryId)) {
                     $query->whereIn('join_goods_category_id', ['6', '7', '8', '9', '10', '11', '12', '30']);
-                } else {
+                } else if($classify != 'GOODS') {
                     $query->where('goods_classify', $classify);
                 }
             })
@@ -200,10 +200,10 @@ class GoodsService
             $query->whereIn('join_goods_category_id', $categoryId);
         })->when($goodsCategory != null, function ($query) use ($goodsCategory) {
             $query->where('goods_category', $goodsCategory);
-        })->when($classify != '', function ($query) use ($classify) {
-            if ($classify == 'GOODS') {
+        })->when($classify != '', function ($query) use ($classify,$categoryId) {
+            if ($classify == 'GOODS' && empty($categoryId)) {
                 $query->whereIn('join_goods_category_id', ['6', '7', '8', '9', '10', '11', '12', '30']);
-            } else {
+            } else if($classify != 'GOODS') {
                 $query->where('goods_classify', $classify);
             }
         })