wuggemail@foxmail.com 3 ヶ月 前
コミット
467668aff6
1 ファイル変更5 行追加2 行削除
  1. 5 2
      app/cxinv/model/FinancialManager.php

+ 5 - 2
app/cxinv/model/FinancialManager.php

@@ -115,7 +115,7 @@ class FinancialManager extends Base{
             }
             $data['manager_status']=$data['balance_num']=='0'?1:2;
         }catch (\Exception $e){
-         #   var_dump($e->getMessage().$e->getFile().$e->getLine());
+           var_dump($e->getMessage().$e->getFile().$e->getLine());
             $data['manager_status'] =3;
             $data['error_remark'] = $e->getMessage();
         }
@@ -191,7 +191,10 @@ class FinancialManager extends Base{
         try{
                if($data['channel'] == 1) {
                  $product = FinancialProducts::with(['productStock','ProductsCombind'])->where($this->getCondition($data))->findOrEmpty();
-                 $this->processSingleProduct($product, $productID,$data);
+                 if($product->isEmpty()) throw new \Exception('出库未找到财务商品信息');
+                 if($data['balance_num']>$product->residue_stock) throw new \Exception('出库数量大于库存');
+                 $item=['id'=>$product->id,'num'=> $product->residue_stock??"0"];
+                 $this->processSingleProduct($item, $productID,$data);
                 } else {
                     if (isset($data['relaArr']) && is_array($data['relaArr'])) {
                         foreach ($data['relaArr'] as $item) {