From 7091de80c9aeec2ca240027ea6be289c7ec77702 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Fri, 24 Jan 2025 14:09:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BeforehandOrderCartInfoLogic.php | 2 +- app/admin/logic/warehouse_product/WarehouseProductLogic.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index c7510bea..c55c97ad 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -61,7 +61,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic public static function appendAdd(array $params): bool { $order = BeforehandOrder::where('id', $params['id'])->find(); - if (!empty($order) && $order->is_confirm == 1 && empty($params['admin_id'])) { + if ((!empty($order) && $order->is_confirm == 1 && empty($params['admin_id'])) || $order['is_outbound'] > 0) { throw new BusinessException('该订单已确认,不能追加商品'); } Db::startTrans(); diff --git a/app/admin/logic/warehouse_product/WarehouseProductLogic.php b/app/admin/logic/warehouse_product/WarehouseProductLogic.php index c99feaf2..56988889 100644 --- a/app/admin/logic/warehouse_product/WarehouseProductLogic.php +++ b/app/admin/logic/warehouse_product/WarehouseProductLogic.php @@ -38,7 +38,7 @@ class WarehouseProductLogic extends BaseLogic // Db::startTrans(); try { $after_nums = 0; - if (!in_array($params['order_type'],[6,7,9])) { + if (!in_array($params['order_type'],[6,9])) { $storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find(); if ($storege) { $after_nums = $storege['nums'] + $params['nums']; @@ -262,9 +262,9 @@ class WarehouseProductLogic extends BaseLogic Db::startTrans(); try { if ($res['financial_pm'] == 1) { - self::incProductDecStorege($res, $res['nums'], $admin_id); - } elseif ($res['financial_pm'] == 0) { self::decProductIncStorege($res, $res['nums'], $admin_id); + } elseif ($res['financial_pm'] == 0) { + self::incProductDecStorege($res, $res['nums'], $admin_id); } $res->delete(); Db::commit();