瀏覽代碼

同步组合支付

gorden 6 月之前
父節點
當前提交
48bb027676
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 6 0
      app/admin/controller/order/WholeController.php
  2. 2 2
      app/admin/service/order/OrderService.php

+ 6 - 0
app/admin/controller/order/WholeController.php

@@ -1832,6 +1832,9 @@ class WholeController extends Curd
         if (in_array('MEALS', $goodsClassifys)) {
             $params['submit_goods_classify'] = 'MEALS';
         }
+        if (in_array('PACKAGE', $goodsClassifys)) {
+            $params['submit_goods_classify'] = 'PACKAGE';
+        }
         if (!empty($params['dept_premises_id'])) {
             $premises = SysDept::where('dept_name', $params['dept_premises_id'])->first();
         }
@@ -2408,6 +2411,9 @@ class WholeController extends Curd
         if (in_array('MEALS', $goodsClassifys)) {
             $params['submit_goods_classify'] = 'MEALS';
         }
+        if (in_array('PACKAGE', $goodsClassifys)) {
+            $params['submit_goods_classify'] = 'PACKAGE';
+        }
         if (!empty($params['dept_premises_id'])) {
             $premises = SysDept::where('dept_name', $params['dept_premises_id'])->first();
         }

+ 2 - 2
app/admin/service/order/OrderService.php

@@ -350,13 +350,13 @@ class OrderService
                     $skuStorageJson['storage'] = $skuStorageJson['storage'] - $goods['nbr'];
                 }
                 if (!isset($skuStorageJson['storage']) || (!empty($skuStorageJson['storage']) && $skuStorageJson['storage'] < 0)) {
-                    throw new BusinessException('库存不足');
+                    throw new BusinessException('库存不足3');
                 }
             }
             $goodsRunning = GoodsRunning::where('join_running_goods_id', $goods['goods_id'])->first();
             $goodsRunning->goods_running_storage = $goodsRunning->goods_running_storage - $goods['nbr'];
             if ($goodsRunning->goods_running_storage < 0) {
-                throw new BusinessException('库存不足');
+                throw new BusinessException('库存不足4');
             }
         }
     }