wugg il y a 1 an
Parent
commit
21d9902d9b
2 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 0 1
      app/admin/controller/CombindStock.php
  2. 1 1
      app/admin/model/GoodStock.php

+ 0 - 1
app/admin/controller/CombindStock.php

@@ -205,7 +205,6 @@ class CombindStock extends Base
 							if($reld==false) throw new \Exception('组合商品库存解除驳回失败');
 						}else{
 						$childarr= Db::name('good')->whereIn('spuCode',array_unique(array_column($comblist,'childCode')))->column('spuCode,usable_stock,is_combind','spuCode');
-	
 							foreach ($comblist as $item){
 								$num = bcmul($item['child_num'],$param['stock_num'],2);
 								if(isset($childarr[$item['childCode']])) {

+ 1 - 1
app/admin/model/GoodStock.php

@@ -20,7 +20,7 @@ class GoodStock extends Model
     //组合商品占用 库存 0 库存返回 1 库存占用
     public function stockSub($spuCode,$num,$flag =1){
     	 $row =$this->withJoin(['wsminfo'],'left')
-            ->field('id,usable_stock')
+            ->field('good_stock.id,usable_stock')
             ->where(['spuCode' => $spuCode, 'warehouse_info.wsm_type'=>[2,5]])
             ->findOrEmpty();
 		 if($row->isEmpty()) throw new \Exception('未找到对应子商品库存信息');