diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index 6776603ad..784318959 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -125,7 +125,7 @@ class StoreOrderController if ($this->services->be(['order_id|unique' => $key, 'uid' => $uid, 'is_del' => 0])) return app('json')->status('extend_order', 410173, ['orderId' => $key, 'key' => $key]); list($addressId, $couponId, $payType, $useIntegral, $mark, $combinationId, $pinkId, $seckill_id, $bargainId, $shipping_type) = $request->postMore([ - 'addressId', 'couponId', ['payType', 'yue'], ['useIntegral', 0], 'mark', ['combinationId', 0], ['pinkId', 0], ['seckill_id', 0], ['bargainId', ''], + 'addressId', 'couponId', ['payType', ''], ['useIntegral', 0], 'mark', ['combinationId', 0], ['pinkId', 0], ['seckill_id', 0], ['bargainId', ''], ['shipping_type', 1], ], true); $payType = strtolower($payType); diff --git a/crmeb/app/services/order/StoreOrderComputedServices.php b/crmeb/app/services/order/StoreOrderComputedServices.php index a2e1e55dd..b984487f8 100644 --- a/crmeb/app/services/order/StoreOrderComputedServices.php +++ b/crmeb/app/services/order/StoreOrderComputedServices.php @@ -448,7 +448,7 @@ class StoreOrderComputedServices extends BaseServices } //会员邮费享受折扣 if ($storePostage) { - $express_rule_number = 0; + $express_rule_number = 100; if (!$userInfo) { /** @var UserServices $userService */ $userService = app()->make(UserServices::class); diff --git a/crmeb/app/services/order/StoreOrderServices.php b/crmeb/app/services/order/StoreOrderServices.php index 5d861817a..c921dcaa9 100644 --- a/crmeb/app/services/order/StoreOrderServices.php +++ b/crmeb/app/services/order/StoreOrderServices.php @@ -1724,6 +1724,24 @@ HTML; */ public function setOrderTypePayOffline(string $orderId) { + if (($count = strpos($orderId, '_')) !== false) { + $orderId = substr($orderId, $count + 1); + } + if (sys_config('offline_postage', 0) == 1) { + $orderInfo = $this->dao->get(['order_id' => $orderId]); + $cartInfoService = app()->make(StoreOrderCartInfoServices::class); + $cartInfo = $cartInfoService->getColumn(['oid' => $orderInfo['id']], 'cart_info', 'id'); + foreach ($cartInfo as $key => &$item) { + $item_arr = json_decode($item, true); + $item_arr['postage_price'] = $item_arr['origin_postage_price'] = 0; + $cartInfoService->update(['id' => $key], ['cart_info' => json_encode($item_arr)]); + } + return $this->dao->update($orderId, [ + 'pay_type' => 'offline', + 'pay_price' => bcsub((string)$orderInfo['pay_price'], (string)$orderInfo['pay_postage'], 2), + 'pay_postage' => 0 + ], 'order_id'); + } return $this->dao->update($orderId, ['pay_type' => 'offline'], 'order_id'); } @@ -2508,7 +2526,7 @@ HTML; switch ($type) { case 'order': - $info = $this->dao->get(['order_id' => $orderId], ['pay_price', 'add_time', 'combination_id', 'seckill_id', 'bargain_id']); + $info = $this->dao->get(['order_id' => $orderId], ['pay_price', 'add_time', 'combination_id', 'seckill_id', 'bargain_id', 'pay_postage']); if (!$info) { throw new PayException('您支付的订单不存在'); } @@ -2529,6 +2547,8 @@ HTML; } $data['pay_price'] = $info['pay_price']; + $data['pay_postage'] = $info['pay_postage']; + $data['offline_postage'] = sys_config('offline_postage', 0); $data['invalid_time'] = $time; break; diff --git a/template/uni-app/pages/goods/cashier/index.vue b/template/uni-app/pages/goods/cashier/index.vue index 269870de7..5119f6eb2 100644 --- a/template/uni-app/pages/goods/cashier/index.vue +++ b/template/uni-app/pages/goods/cashier/index.vue @@ -1,9 +1,9 @@