From 831e59842ad0a2fb2a571eaa70d93f6dfee74e55 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Wed, 27 Mar 2024 17:33:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=A4=B1=E8=B4=A5=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=A4=B1=E8=B4=A5=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/DoctorIdenFail.php | 10 ++++++++ app/Model/DoctorIntroductionRecord.php | 10 ++++++++ app/Services/DoctorAuthService.php | 35 ++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/app/Model/DoctorIdenFail.php b/app/Model/DoctorIdenFail.php index 691b7f7..7ef460d 100644 --- a/app/Model/DoctorIdenFail.php +++ b/app/Model/DoctorIdenFail.php @@ -54,4 +54,14 @@ class DoctorIdenFail extends Model { return self::where($params)->get($fields); } + + /** + * 删除 + * @param array $params + * @return int|mixed + */ + public static function del(array $params): mixed + { + return self::where($params)->delete(); + } } diff --git a/app/Model/DoctorIntroductionRecord.php b/app/Model/DoctorIntroductionRecord.php index 510aa17..90fece5 100644 --- a/app/Model/DoctorIntroductionRecord.php +++ b/app/Model/DoctorIntroductionRecord.php @@ -92,4 +92,14 @@ class DoctorIntroductionRecord extends Model ->first($fields); } + /** + * 删除 + * @param array $params + * @return int|mixed + */ + public static function del(array $params): mixed + { + return self::where($params)->delete(); + } + } diff --git a/app/Services/DoctorAuthService.php b/app/Services/DoctorAuthService.php index 382dc40..9e5499c 100644 --- a/app/Services/DoctorAuthService.php +++ b/app/Services/DoctorAuthService.php @@ -645,6 +645,18 @@ class DoctorAuthService extends BaseService } } + // 删除认证失败字段 + if ($doctor['iden_auth_status'] == 3){ + // 删除认证失败字段 + $params = array(); + $params['doctor_id'] = $user_info['client_user_id']; + $res = DoctorIdenFail::del($params); + if (!$res){ + Db::rollBack(); + return fail(HttpEnumCode::SERVER_ERROR); + } + } + Db::commit(); } catch (\Exception $e) { Db::rollBack(); @@ -1136,6 +1148,27 @@ class DoctorAuthService extends BaseService Db::beginTransaction(); try { + // 审核不通过 + if ($doctor['iden_auth_status'] == 3){ + // 删除认证失败字段 + $params = array(); + $params['doctor_id'] = $user_info['client_user_id']; + $res = DoctorIdenFail::del($params); + if (!$res){ + Db::rollBack(); + return fail(HttpEnumCode::SERVER_ERROR); + } + + // 删除简介修改记录表 + $params = array(); + $params['doctor_id'] = $user_info['client_user_id']; + $res = DoctorIntroductionRecord::del($params); + if (!$res){ + Db::rollBack(); + return fail(HttpEnumCode::SERVER_ERROR); + } + } + // 新增医生简介修改记录表 $doctor_introduction_record_data['doctor_id'] = $doctor['doctor_id']; $doctor_introduction_record = DoctorIntroductionRecord::addDoctorIntroductionRecord($doctor_introduction_record_data); @@ -1157,6 +1190,8 @@ class DoctorAuthService extends BaseService return fail(HttpEnumCode::SERVER_ERROR); } + + Db::commit(); } catch (\Exception $e) { Db::rollBack();