From 4cbb2f5307018e4c6c78da8015cf91c714913428 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Wed, 8 Mar 2023 11:56:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=97=AE=E8=AF=8A=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Amqp/Consumer/AssignDoctorConsumer.php | 1 + app/Controller/UserController.php | 30 +++++++++++----------- app/Services/InquiryService.php | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app/Amqp/Consumer/AssignDoctorConsumer.php b/app/Amqp/Consumer/AssignDoctorConsumer.php index 947f9c6..cb8c800 100644 --- a/app/Amqp/Consumer/AssignDoctorConsumer.php +++ b/app/Amqp/Consumer/AssignDoctorConsumer.php @@ -113,6 +113,7 @@ class AssignDoctorConsumer extends ConsumerMessage $UserDoctorService = new UserDoctorService(); $doctor_id = $UserDoctorService->getInquiryAssignDoctor($order_inquiry['inquiry_type']); if (empty($doctor_id)){ + Db::rollBack(); Log::getInstance()->error("重回队列,目前没有合适医生"); $redis_value = $redis->get($redis_key); if (!empty($redis_value)){ diff --git a/app/Controller/UserController.php b/app/Controller/UserController.php index 2dcfced..8a18868 100644 --- a/app/Controller/UserController.php +++ b/app/Controller/UserController.php @@ -81,21 +81,21 @@ class UserController extends AbstractController // dump($wx_info_data);die; // 发起支付 -// $out_trade_no = $this->request->input('out_trade_no'); -// $generator = $this->container->get(IdGeneratorInterface::class); -// -// $WechatPay = new WechatPay(1); -// -// // 获取预支付交易会话标识 -// $total = 0.01 * 100; -// $prepay = $WechatPay->getJsapiPrepayId($out_trade_no,$total,"omgU35DlE-rxTAGgcBjOuc4xdcX8"); -// if (empty($prepay)){ -// return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败"); -// } -// -// // 获取小程序支付配置 -// $pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']); -// return $this->response->json($pay_config); + $out_trade_no = $this->request->input('out_trade_no'); + $generator = $this->container->get(IdGeneratorInterface::class); + + $WechatPay = new WechatPay(1); + + // 获取预支付交易会话标识 + $total = 0.01 * 100; + $prepay = $WechatPay->getJsapiPrepayId($out_trade_no,$total,"omgU35DlE-rxTAGgcBjOuc4xdcX8"); + if (empty($prepay)){ + return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败"); + } + + // 获取小程序支付配置 + $pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']); + return $this->response->json($pay_config); // 发起退款 // $WechatPay = new WechatPay(1); diff --git a/app/Services/InquiryService.php b/app/Services/InquiryService.php index 76cadc0..a6cef97 100644 --- a/app/Services/InquiryService.php +++ b/app/Services/InquiryService.php @@ -588,7 +588,7 @@ class InquiryService extends BaseService } // 检测问诊订单状态 - if (in_array($order_inquiry['inquiry_status'], [2, 3, 4, 5])) { + if (!in_array($order_inquiry['inquiry_status'], [2, 3, 4, 5])) { // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消) throw new BusinessException("订单状态错误"); }