Browse Source

完善功能

gorden 8 months ago
parent
commit
3c18130385
1 changed files with 3 additions and 0 deletions
  1. 3 0
      app/admin/service/goods/GoodsService.php

+ 3 - 0
app/admin/service/goods/GoodsService.php

@@ -68,6 +68,7 @@ class GoodsService
     public static function selectAllByCategoryForRuleAddComponent($category = "GOODS")
     {
         $categoryIds = [];
+        $categorySuperIds = [];
         if ($category == 'GOODS') {
             $categorySuperIds = [5];
         } elseif ($category == 'SERVICE') {
@@ -92,6 +93,8 @@ class GoodsService
 //            ->where('goods_classify', $category)
             ->when(!empty($categoryIds), function ($query) use ($categoryIds) {
                 $query->whereIn('join_goods_category_id', $categoryIds);
+            })->when(empty($categoryIds), function ($query) {
+                $query->where('goods_classify','<>', 'RECHARGE');
             })->select('goods_id', 'goods_name', 'join_goods_category_id')
             ->get()
             ->toArray();