Quellcode durchsuchen

花材类别:改价,库存预警只显示常用

林琦海 vor 5 Jahren
Ursprung
Commit
5499090872

+ 1 - 1
app-ghs/controllers/ProductController.php

@@ -67,7 +67,7 @@ class ProductController extends BaseController
         $oftenItemIds = ProductClass::getOftenItemIds($shopId);
 
         //组装数据: [{classId:'','className:'',child:[{itemInfoData}]}]
-        $data = ProductService::assembleData($classIds,$itemIdsInfo,$itemInfoData,$oftenItemIds);
+        $data = ProductService::assembleData($classIds,$itemIdsInfo,$itemInfoData,$oftenItemIds,$type);
 
         util::success($data);
     }

+ 7 - 2
biz-ghs/product/services/ProductService.php

@@ -15,7 +15,7 @@ class ProductService extends BaseService
     const OFTEN_CLASS_ID = '-2';
 
     //组装分类花材数据
-    public static function assembleData($classIds,$itemIdsInfo,$itemInfoData,$oftenItemIds)
+    public static function assembleData($classIds,$itemIdsInfo,$itemInfoData,$oftenItemIds,$type)
     {
         $oftenItemInfoData = [];
         $allData = [];
@@ -52,6 +52,11 @@ class ProductService extends BaseService
                 'child'=>$oftenItemInfoData,
             ]
         ];
+
+        //改价,库存预警只要常用分类
+        if(in_array($type,['waring','change-price'])){
+            return $oftenData;
+        }
         $classData = [];
 
         foreach ($classIds as $v){
@@ -84,7 +89,7 @@ class ProductService extends BaseService
 
         }
 
-        
+
         //$data = array_merge($oftenData,$allData,$classData);
         //去除全部
         $data = array_merge($oftenData,$classData);