diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 63bdb3a90..b8ee80594 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 56988889e..76ba8499e 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 8735ba11e..c02213566 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();