From d5e9bbec9a0105921ed7fd3361c777af3899407b Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Sat, 8 Feb 2025 14:26:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=95=86=E5=93=81=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=88=B0=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 7 +++++-- .../logic/warehouse_product/WarehouseProductLogic.php | 2 +- app/api/logic/order/OrderLogic.php | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 63bdb3a9..b8ee8059 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -263,7 +263,7 @@ class BeforehandOrderLogic extends BaseLogic 'cart_id' => '', 'store_id' => $params['store_id'] ?? 0, 'shipping_type' => 2, //配送方式 1=快递 ,2=门店自提 - 'deduction_price' => 0, //抵扣金额 + 'deduction_price' => $params['deduction_price'] ?? 0, //抵扣金额 'source' => OrderEnum::SOURCE_20, //来源 'order_type' => $order['order_type'], 'is_storage' => 0, @@ -272,9 +272,12 @@ class BeforehandOrderLogic extends BaseLogic if ($_order['pay_price'] == 0) { throw new BusinessException('支付金额不能为0'); } + if ($_order['deduction_price'] > 0) { + $_order['pay_price'] = bcsub($_order['pay_price'], $_order['deduction_price'], 2); + } $_order['uid'] = $uid; $_order['spread_uid'] = 0; - $_order['mark'] = ''; + $_order['mark'] = $params['mark'] ?? ''; $_order['real_name'] = $user['real_name']; $_order['user_phone'] = $user['mobile']; $_order['pay_type'] = $params['pay_type']; diff --git a/app/admin/logic/warehouse_product/WarehouseProductLogic.php b/app/admin/logic/warehouse_product/WarehouseProductLogic.php index 56988889..76ba8499 100644 --- a/app/admin/logic/warehouse_product/WarehouseProductLogic.php +++ b/app/admin/logic/warehouse_product/WarehouseProductLogic.php @@ -129,7 +129,7 @@ class WarehouseProductLogic extends BaseLogic if ($params['order_type'] != 6) { $storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find(); if ($storege) { - if (in_array($params['order_type'], [1, 4])) { + if (($params['store_id'] == 3 && in_array($params['order_type'], [1, 2, 3, 4, 8])) || in_array($params['order_type'], [1, 4])) { SystemStoreStorage::create([ 'store_id' => $params['store_id'], 'admin_id' => $params['admin_id'], diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 8735ba11..c0221356 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -290,6 +290,10 @@ class OrderLogic extends BaseLogic $_order['verify_code'] = $verify_code; $_order['reservation_time'] = null; $_order['reservation'] = 0; + if (isset($params['deduction_price']) && $params['deduction_price'] > 0) { + $_order['deduction_price'] = $params['deduction_price']; + $_order['pay_price'] = bcsub($_order['pay_price'], $_order['deduction_price'], 2); + } if ($uid > 0) { $address = UserAddress::where(['uid' => $uid])->find();