diff --git a/app/Amqp/Consumer/AutoFinishInquiryDelayDirectConsumer.php b/app/Amqp/Consumer/AutoFinishInquiryDelayDirectConsumer.php index b7763bb..a50faf3 100644 --- a/app/Amqp/Consumer/AutoFinishInquiryDelayDirectConsumer.php +++ b/app/Amqp/Consumer/AutoFinishInquiryDelayDirectConsumer.php @@ -138,7 +138,7 @@ class AutoFinishInquiryDelayDirectConsumer extends ConsumerMessage $this->handleOrderInquiryCase($order_inquiry); // 处理回写患者病情记录-回写失败不做处理 - $this->handlePatientPathography($order_inquiry['order_inquiry_id']); + $this->handlePatientPathography($order_inquiry); // 处理医生服务患者数量 $this->handleDoctorServedPatientsNum($order_inquiry['doctor_id']); diff --git a/app/Services/LoginService.php b/app/Services/LoginService.php index e42f146..d78bd84 100644 --- a/app/Services/LoginService.php +++ b/app/Services/LoginService.php @@ -38,22 +38,32 @@ class LoginService extends BaseService $wx_code = $this->request->input('wx_code'); $user_type = $this->request->input('user_type'); + // 获取微信用户数据 try { $weChat = new Wechat($user_type); // 获取手机号 $phone_info = $weChat->getPhone($phone_code); - if (empty($phone_info) || empty($phone_info['phone_info']) || empty($phone_info['phone_info']['purePhoneNumber'])) { + if (empty($phone_info)){ + return fail(HttpEnumCode::GET_WX_ERROR); + } + + if (empty($phone_info['phone_info']) || empty($phone_info['phone_info']['purePhoneNumber'])) { return fail(HttpEnumCode::GET_WX_ERROR); } // 获取用户openid $wx_info_data = $weChat->codeToSession($wx_code); + if (empty($wx_info_data)){ + return fail(HttpEnumCode::GET_WX_ERROR); + } + if (empty($wx_info_data['session_key']) || empty($wx_info_data['openid'])) { return fail(HttpEnumCode::GET_WX_ERROR); } }catch (\Throwable $e){ + Log::getInstance("LoginService-wechatMobileLogin")->error($e->getMessage()); return fail(HttpEnumCode::GET_WX_ERROR); } @@ -86,7 +96,7 @@ class LoginService extends BaseService $data['mobile'] = $phone_info['phone_info']['purePhoneNumber']; $data['wx_mobile'] = $phone_info['phone_info']['purePhoneNumber']; $data['user_type'] = $user_type; - $data['register_method'] = 1;//注册方式(1:小程序授权 2:手机号 ) + $data['register_method'] = 1;// 注册方式(1:小程序授权 2:手机号) $data['avatar'] = $avatar; $user = UserModel::addUser($data); if (empty($user)) {