From c3d68e6aca1f6cd1952dc62a7c326ca73995b71b Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Fri, 17 Mar 2023 13:34:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A3=80=E6=B5=8B=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD=E8=AF=81=E5=8F=B7=E6=98=AF=E5=90=A6=E5=B7=B2=E8=A2=AB?= =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/UserDoctorInfo.php | 10 ++++++++++ app/Services/DoctorAuthService.php | 8 ++++++++ config/routes.php | 2 -- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/Model/UserDoctorInfo.php b/app/Model/UserDoctorInfo.php index 82ee57d..6765ee5 100644 --- a/app/Model/UserDoctorInfo.php +++ b/app/Model/UserDoctorInfo.php @@ -77,4 +77,14 @@ class UserDoctorInfo extends Model { return self::where($params)->update($data); } + + /** + * 获取是否存在 + * @param array $params + * @return bool + */ + public static function getExists(array $params): bool + { + return self::where($params)->exists(); + } } diff --git a/app/Services/DoctorAuthService.php b/app/Services/DoctorAuthService.php index 97dbd03..4990d8c 100644 --- a/app/Services/DoctorAuthService.php +++ b/app/Services/DoctorAuthService.php @@ -108,6 +108,14 @@ class DoctorAuthService extends BaseService return fail(HttpEnumCode::HTTP_ERROR, "已通过实名认证,无法修改"); } + // 检测身份证号是否已被实名认证 + $params = array(); + $params['card_num'] = $card_num; + $res = UserDoctorInfo::getExists($params); + if ($res){ + return fail(HttpEnumCode::HTTP_ERROR,"身份证已被使用"); + } + // 网易易盾认证 // 实人认证-生产环境开启 $IdCard = new IdCard(); diff --git a/config/routes.php b/config/routes.php index 17d784e..1f3a42c 100644 --- a/config/routes.php +++ b/config/routes.php @@ -528,8 +528,6 @@ Router::post('/23', [CallBackController::class, 'imCallBack']); // 获取问诊消息列表-消息 Router::post('/24', [CallBackController::class, 'imCallBack']); -// 新增关注医生 -Router::post('/25', [CallBackController::class, 'imCallBack']); // 获取患者-医生关注状态 Router::post('/26', [CallBackController::class, 'imCallBack']);