From fe300a6cd9913298be72aa7a3fee78632d486962 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 10 May 2024 09:53:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{merchat => merchant}/MerchantLists.php | 0 .../controller/order/RetailOrderController.php | 17 ++++++++++++----- app/common/logic/PayNotifyLogic.php | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-) rename app/admin/lists/{merchat => merchant}/MerchantLists.php (100%) diff --git a/app/admin/lists/merchat/MerchantLists.php b/app/admin/lists/merchant/MerchantLists.php similarity index 100% rename from app/admin/lists/merchat/MerchantLists.php rename to app/admin/lists/merchant/MerchantLists.php diff --git a/app/api/controller/order/RetailOrderController.php b/app/api/controller/order/RetailOrderController.php index 411dd09..e14df7b 100644 --- a/app/api/controller/order/RetailOrderController.php +++ b/app/api/controller/order/RetailOrderController.php @@ -73,20 +73,25 @@ class RetailOrderController extends BaseApiController $user = User::where('id', $this->request->userId)->find(); $cartId = (array)$this->request->post('cart_id', []); $mer_id = (array)$this->request->post('mer_id', 0); - if ($mer_id <= 0) { + $pay_type = (int)$this->request->post('pay_type'); + $addressId = (int)$this->request->post('address_id'); + $auth_code = $this->request->post('auth_code'); //微信支付条码 + $params = $this->request->post(); + if ($mer_id <= 0 && $pay_type!=9) { return $this->fail('自提点不能为空'); } if (count($cartId) > 100) { return $this->fail('购物车商品不能超过100个'); } - $addressId = (int)$this->request->post('address_id'); - $pay_type = (int)$this->request->post('pay_type'); - $auth_code = $this->request->post('auth_code'); //微信支付条码 - $params = $this->request->post(); + + if($pay_type==9){ + + } $order = OrderLogic::createOrder($cartId, $addressId, null, $params); if ($order != false) { switch ($pay_type) { case PayEnum::WECHAT_PAY: + //余额支付 $user = User::where('id', $this->request->userId)->find(); $res = RetailOrderLogic::payBalance($user, $order); if (RetailOrderLogic::hasError()) { @@ -100,6 +105,7 @@ class RetailOrderController extends BaseApiController } break; case PayEnum::WECHAT_PAY: + //微信支付 $redirectUrl = $params['redirect'] ?? '/pages/payment/payment'; $result = PaymentLogic::pay($pay_type, 'cashierclass', $order, $this->userInfo['terminal'], $redirectUrl); if (PaymentLogic::hasError()) { @@ -108,6 +114,7 @@ class RetailOrderController extends BaseApiController return $this->success('', $result); break; case PayEnum::WECHAT_PAY_BARCODE: + //微信条码支付 $result = PaymentLogic::codepay($auth_code, $order); if (PaymentLogic::hasError()) { return $this->fail(PaymentLogic::getError(), $params); diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 838c77f..9eb30bc 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -58,6 +58,9 @@ class PayNotifyLogic extends BaseLogic $order->money = bcdiv($extra['amount']['payer_total'],100,2); $order->paid = 1; $order->status = 1; + if($order->pay_type==9){ + $order->status = 2; + } $order->save(); if ($order['cart_id']) { if (!is_array($order['cart_id'])) {