Browse Source

库存控制

shish 5 years ago
parent
commit
a135bccbcc
1 changed files with 2 additions and 1 deletions
  1. 2 1
      biz-ghs/product/classes/ProductClass.php

+ 2 - 1
biz-ghs/product/classes/ProductClass.php

@@ -1006,9 +1006,10 @@ class ProductClass extends BaseClass
             $shopIds = ShopService::getShopIds($data['sjId']);
             $shopIds = ShopService::getShopIds($data['sjId']);
             foreach ($shopIds as $shopId) {
             foreach ($shopIds as $shopId) {
                 $data['shopId'] = $shopId;
                 $data['shopId'] = $shopId;
-                //非当前门店库存默认为0
+                //非当前门店库存默认为0并且是下架状态
                 if ($currentShopId != $shopId) {
                 if ($currentShopId != $shopId) {
                     $data['stock'] = 0;
                     $data['stock'] = 0;
+                    $data['status'] = 2;
                 }
                 }
                 $res = self::add($data);
                 $res = self::add($data);
                 if ($stock > 0 && $res && $currentShopId == $shopId) {
                 if ($stock > 0 && $res && $currentShopId == $shopId) {