wuggemail@foxmail.com 3 miesięcy temu
rodzic
commit
a6d01cd2d9

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

@@ -417,6 +417,8 @@ class FinancialManager extends Base{
                 },$productID);
                 $data['balance_num']=bcsub($data['balance_num'],$item['num'],8);
             }
+        }else{
+            throw new \Exception('商品未找到');
         }
         return $kt;
     }

+ 2 - 0
app/cxinv/model/TzProduct.php

@@ -28,6 +28,8 @@ class TzProduct extends Base
 
     public static function onAfterInsert(Model $model): void
     {
+        if($model->Product->status!=1) throw new \Exception($model->Product->goodName.'商品已禁用');
+
         if($model['type']==2){
             try{
                 $adjust=$model->Adjust;