Prechádzať zdrojové kódy

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

林琦海 5 rokov pred
rodič
commit
104c415408
1 zmenil súbory, kde vykonal 7 pridanie a 1 odobranie
  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'){
-            $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);
         }