更新获取身份认证信息接口认证失败原因字段返回
This commit is contained in:
parent
2bda61d29f
commit
c68c3ea000
@ -5,6 +5,7 @@ namespace App\Services;
|
||||
use App\Constants\DoctorTitleCode;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Model\DoctorExpertise;
|
||||
use App\Model\DoctorIdenFail;
|
||||
use App\Model\Hospital;
|
||||
use App\Model\HospitalDepartmentCustom;
|
||||
use App\Model\UserDoctor;
|
||||
@ -212,7 +213,6 @@ class DoctorAuthService extends BaseService
|
||||
'user_id',
|
||||
'idcard_status',
|
||||
'iden_auth_status',
|
||||
'iden_auth_fail_reason',
|
||||
'avatar',
|
||||
'hospital_id',
|
||||
'department_custom_id',
|
||||
@ -302,6 +302,17 @@ class DoctorAuthService extends BaseService
|
||||
$UserDoctorService = new UserDoctorService();
|
||||
$result['doctor_expertise'] = $UserDoctorService->getDoctorSelectedExpertise($doctor['doctor_id']);
|
||||
|
||||
// 获取医生身份认证失败原因
|
||||
$iden_auth_fail_reson = $this->getIdenAuthFailReason($doctor['iden_auth_status'], $doctor['doctor_id']);
|
||||
|
||||
$result['avatar_reason'] = $iden_auth_fail_reson['avatar_reason'] ?? "";
|
||||
$result['department_custom_mobile_reason'] = $iden_auth_fail_reson['department_custom_mobile_reason'] ?? "";
|
||||
$result['brief_introduction_reason'] = $iden_auth_fail_reson['brief_introduction_reason'] ?? "";
|
||||
$result['be_good_at_reason'] = $iden_auth_fail_reson['be_good_at_reason'] ?? "";
|
||||
$result['license_cert_reason'] = $iden_auth_fail_reson['license_cert_reason'] ?? "";
|
||||
$result['qualification_cert_reason'] = $iden_auth_fail_reson['qualification_cert_reason'] ?? "";
|
||||
$result['work_cert_reason'] = $iden_auth_fail_reson['work_cert_reason'] ?? "";
|
||||
|
||||
return success($result);
|
||||
}
|
||||
|
||||
@ -643,4 +654,64 @@ class DoctorAuthService extends BaseService
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生身份认证失败原因
|
||||
* @param int|string $iden_auth_status
|
||||
* @param string|int $doctor_id
|
||||
* @return array
|
||||
*/
|
||||
public function getIdenAuthFailReason(int|string $iden_auth_status, string|int $doctor_id): array
|
||||
{
|
||||
$result = array();
|
||||
|
||||
// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
if ($iden_auth_status == 3) {
|
||||
// 获取认证失败字段
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$doctor_iden_fails = DoctorIdenFail::getList($params);
|
||||
|
||||
if (!empty($doctor_iden_fails)) {
|
||||
foreach ($doctor_iden_fails as $doctor_iden_fail) {
|
||||
// 头像
|
||||
if ($doctor_iden_fail['field_name'] == "avatar") {
|
||||
$result['avatar_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
|
||||
// 科室电话
|
||||
if ($doctor_iden_fail['field_name'] == "department_custom_mobile") {
|
||||
$result['department_custom_mobile_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
|
||||
// 医生简介
|
||||
if ($doctor_iden_fail['field_name'] == "brief_introduction") {
|
||||
$result['brief_introduction_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
|
||||
// 擅长
|
||||
if ($doctor_iden_fail['field_name'] == "be_good_at") {
|
||||
$result['be_good_at_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
|
||||
// 医师执业证
|
||||
if ($doctor_iden_fail['field_name'] == "license_cert") {
|
||||
$result['license_cert_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
|
||||
// 医师资格证
|
||||
if ($doctor_iden_fail['field_name'] == "qualification_cert") {
|
||||
$result['qualification_cert_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
|
||||
// 医师工作证
|
||||
if ($doctor_iden_fail['field_name'] == "work_cert") {
|
||||
$result['work_cert_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user