From 0d99739e39f050f8d7cf85373bba4a51f3fe9cea Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Wed, 21 Feb 2024 13:56:48 +0800 Subject: [PATCH] 1 --- app/Services/DoctorAuthService.php | 2 +- app/Services/UserDoctorService.php | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/Services/DoctorAuthService.php b/app/Services/DoctorAuthService.php index ba37ce0..6474599 100644 --- a/app/Services/DoctorAuthService.php +++ b/app/Services/DoctorAuthService.php @@ -806,7 +806,7 @@ class DoctorAuthService extends BaseService } // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败) - if ($doctor['iden_auth_status'] != 3){ + if ($doctor['iden_auth_status'] != 3 && $doctor['iden_auth_status'] != 1){ return success(null); } diff --git a/app/Services/UserDoctorService.php b/app/Services/UserDoctorService.php index 62d6069..3633d41 100644 --- a/app/Services/UserDoctorService.php +++ b/app/Services/UserDoctorService.php @@ -1781,7 +1781,8 @@ class UserDoctorService extends BaseService /** * 新增医生接诊 * @return array - * @throws GuzzleException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function addDoctorInquiry(): array { @@ -1798,17 +1799,21 @@ class UserDoctorService extends BaseService return fail(HttpEnumCode::HTTP_ERROR, "接诊失败"); } - $redis = $this->container->get(Redis::class); - $redis_key = "order_inquiry_lock_" . $order_inquiry_id; - $redis_lock = $redis->setnx($redis_key,1); - if (!$redis_lock){ - // 设置失败,表示已经设置该值 + try { + $redis = $this->container->get(Redis::class); + $redis_key = "order_inquiry_lock_" . $order_inquiry_id; + $redis_lock = $redis->setnx($redis_key,1); + if (!$redis_lock){ + // 设置失败,表示已经设置该值 + return fail(HttpEnumCode::HTTP_SUCCESS,"请您稍后重试"); + } + + // 设置过期时间 + $redis->expire($redis_key,3); + }catch (\Throwable $e){ return fail(HttpEnumCode::HTTP_SUCCESS,"请您稍后重试"); } - // 设置过期时间 - $redis->expire($redis_key,3); - if ($order_inquiry['inquiry_status'] != 3) { // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消) return fail(HttpEnumCode::HTTP_ERROR, "接诊失败"); @@ -1825,6 +1830,8 @@ class UserDoctorService extends BaseService return fail(HttpEnumCode::HTTP_ERROR, "订单未支付,无法接诊"); } + // 获取系统问诊配置 + Db::beginTransaction(); try { @@ -1836,6 +1843,8 @@ class UserDoctorService extends BaseService $params['order_inquiry_id'] = $order_inquiry_id; OrderInquiry::edit($params,$data); + // 获取订单结束周期 + // 添加自动结束队列 if ($order_inquiry['inquiry_type'] == 1 || $order_inquiry['inquiry_type'] == 3){ // 专家问诊-公益问诊