wugg 1 year ago
parent
commit
c4f8f84124
1 changed files with 7 additions and 5 deletions
  1. 7 5
      app/admin/controller/OrderOutChild.php

+ 7 - 5
app/admin/controller/OrderOutChild.php

@@ -672,11 +672,13 @@ class OrderOutChild extends Base
                     'holder_id' => $sale[$child[$value['outChildCode']]['orderCode']]['cgderid']
                 ]);
 
-                $stock =  Db::name('good_stock') ->where(['is_del' => 0, 'spuCode' => $sale[$child[$value['outChildCode']]['orderCode']]['good_code'], 'wsm_code' => $child[$value['outChildCode']]['wsm_code']])->findOrEmpty();
-                if(empty($stock))throw new \Exception('商品库存数未找到');
-                if($stock['wait_out_stock']<$child[$value['outChildCode']]['num']){
-                    	throw new \Exception('商品库存数待出库不足');
-                }
+               if($sale[$child[$value['outChildCode']]['orderCode']]['is_stock']==1){
+		            $stock =  Db::name('good_stock') ->where(['is_del' => 0, 'spuCode' => $sale[$child[$value['outChildCode']]['orderCode']]['good_code'], 'wsm_code' => $child[$value['outChildCode']]['wsm_code']])->findOrEmpty();
+		            if(empty($stock))throw new \Exception('商品库存数未找到');
+		            if($stock['wait_out_stock']<$child[$value['outChildCode']]['num']){
+			            throw new \Exception('商品库存数待出库不足');
+		            }
+	            }
                 //库存
                $stock_up= Db::name('good_stock')
                     ->data(['updatetime' => $date])