Browse Source

非库存商品不校验库存数

wufeng 2 years ago
parent
commit
3a7cde7bd2
2 changed files with 2 additions and 1 deletions
  1. 1 0
      app/admin/controller/After.php
  2. 1 1
      app/admin/controller/Sale.php

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

@@ -793,6 +793,7 @@ class After extends \app\BaseController
                 return error_show(1005,"参数post_fee不能为空");
             }
         }
+        Db::startTrans();
         try {
             $returninfo = Db::name("order_returninfo")->where(["returnCode"=>$bkcode])->find();
             if($returninfo==false){

+ 1 - 1
app/admin/controller/Sale.php

@@ -2943,7 +2943,7 @@ class Sale extends Base
             return error_show(1002, "未找到商品数据");
         }
 
-        $stock = 0;
+        $stock = 9999;//默认库存数为9999,无实际意义,表示库存不限,只有库存商品才需要去数据库里查验可用库存
         if ($ct['is_stock'] == 1) {
             $good_stock = Db::name("good_stock")->where(["spuCode" => $ct['spuCode'], "is_del" => 0])->find();
             $stock = isset($good_stock['usable_stock']) ? $good_stock['usable_stock'] : "0";