diff --git a/app/Services/DoctorAuthService.php b/app/Services/DoctorAuthService.php index 097072d..11d0264 100644 --- a/app/Services/DoctorAuthService.php +++ b/app/Services/DoctorAuthService.php @@ -1051,22 +1051,49 @@ class DoctorAuthService extends BaseService return fail(HttpEnumCode::HTTP_ERROR, "审核中,暂不允许修改"); } + $avatar = $doctor['avatar']; + $brief_introduction = $doctor['brief_introduction']; + $be_good_at = $doctor['be_good_at']; + + if ($doctor['introduction_status'] == 3){ + // 获取个人简介修改记录 + $params = array(); + $params['doctor_id'] = $doctor['doctor_id']; + $doctor_introduction_record = DoctorIntroductionRecord::getOne($params); + if (empty($doctor_introduction_record)){ + return fail(HttpEnumCode::HTTP_ERROR, "提交失败"); + } + + if (!empty($doctor_introduction_record['avatar'])){ + $avatar = $doctor_introduction_record['avatar']; + } + + if (!empty($doctor_introduction_record['brief_introduction'])){ + $brief_introduction = $doctor_introduction_record['brief_introduction']; + } + + if (!empty($doctor_introduction_record['be_good_at'])){ + $be_good_at = $doctor_introduction_record['be_good_at']; + } + } + + // 组合存储数据 $doctor_introduction_record_data = array(); // 头像 $request_params['avatar'] = PcreMatch::pregRemoveOssWebsite($request_params['avatar']); - if ($doctor['avatar'] != $request_params['avatar']) { + if ($avatar != $request_params['avatar']) { $doctor_introduction_record_data['avatar'] = $request_params['avatar']; } // 医生简介 - if ($doctor['brief_introduction'] != $request_params['brief_introduction']) { + if ($brief_introduction != $request_params['brief_introduction']) { $doctor_introduction_record_data['brief_introduction'] = $request_params['brief_introduction']; } // 擅长领域 - if ($doctor['be_good_at'] != $request_params['be_good_at']) { + if ($be_good_at != $request_params['be_good_at']) { $doctor_introduction_record_data['be_good_at'] = $request_params['be_good_at']; }