Explorar o código

库存预警接口增加支持shopId传参

林琦海 %!s(int64=5) %!d(string=hai) anos
pai
achega
104c415408
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      app/ghs/controllers/ProductController.php

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

@@ -40,7 +40,13 @@ class ProductController extends BaseController
 
 
         //库存预警
         //库存预警
         if($type=='waring'){
         if($type=='waring'){
-            $waringItemIds = ProductClass::getItemIdsWarning($this->sjId,$this->shopId);
+            //shopId 改为可以前端传,默认是当前shopId linqh  2021.1.26
+            $shopId = Yii::$app->request->get('shopId',0);
+            if(!$shopId){
+                $shopId = $this->shopId;
+            }
+          
+            $waringItemIds = ProductClass::getItemIdsWarning($this->sjId,$shopId);
             $itemIds = array_intersect($itemIds,$waringItemIds);
             $itemIds = array_intersect($itemIds,$waringItemIds);
         }
         }