新增:获取个人简介审核失败原因、获取身份认证审核失败原因、获取身份认证信息修改
This commit is contained in:
@@ -19,7 +19,7 @@ use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hyperf\DbConnection\Db;
|
||||
|
||||
/**
|
||||
* 医生认证
|
||||
* 医生身份认证
|
||||
*/
|
||||
class DoctorAuthService extends BaseService
|
||||
{
|
||||
@@ -338,20 +338,6 @@ 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'] ?? "";
|
||||
if ($source == 1){
|
||||
$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'] ?? "";
|
||||
}
|
||||
$result['department_custom_name_reason'] = $iden_auth_fail_reson['department_custom_name_reason'] ?? "";
|
||||
|
||||
return success($result);
|
||||
}
|
||||
|
||||
@@ -761,63 +747,97 @@ class DoctorAuthService extends BaseService
|
||||
|
||||
/**
|
||||
* 获取医生身份认证失败原因
|
||||
* @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
|
||||
public function getIdenAuthFailReason(): array
|
||||
{
|
||||
$result = array();
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$doctor = UserDoctor::getOne($params);
|
||||
if (empty($doctor)) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "未知医生");
|
||||
}
|
||||
|
||||
// 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
if ($doctor['idcard_status'] != 1) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请先实名认证");
|
||||
}
|
||||
|
||||
// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
if ($iden_auth_status == 3) {
|
||||
// 获取认证失败字段
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$doctor_iden_fails = DoctorIdenFail::getList($params);
|
||||
if ($doctor['iden_auth_status'] != 3){
|
||||
return success(null);
|
||||
}
|
||||
|
||||
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'];
|
||||
}
|
||||
// 获取认证失败字段
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor['doctor_id'];
|
||||
$doctor_iden_fails = DoctorIdenFail::getList($params);
|
||||
if (empty($doctor_iden_fails)){
|
||||
return success(null);
|
||||
}
|
||||
|
||||
// 科室电话
|
||||
if ($doctor_iden_fail['field_name'] == "department_custom_mobile") {
|
||||
$result['department_custom_mobile_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
$result = array();
|
||||
foreach ($doctor_iden_fails as $doctor_iden_fail) {
|
||||
$result[$doctor_iden_fail['field_name']] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
|
||||
// 科室名称
|
||||
if ($doctor_iden_fail['field_name'] == "department_custom_name") {
|
||||
$result['department_custom_name_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
return success($result);
|
||||
}
|
||||
|
||||
// 医生简介
|
||||
if ($doctor_iden_fail['field_name'] == "brief_introduction") {
|
||||
$result['brief_introduction_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
/**
|
||||
* 获取医生个人简介审核失败原因
|
||||
* @return array
|
||||
*/
|
||||
public function getDoctorIntroductionFailReason(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
// 擅长
|
||||
if ($doctor_iden_fail['field_name'] == "be_good_at") {
|
||||
$result['be_good_at_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$doctor = UserDoctor::getOne($params);
|
||||
if (empty($doctor)) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "未知医生");
|
||||
}
|
||||
|
||||
// 医师执业证
|
||||
if ($doctor_iden_fail['field_name'] == "license_cert") {
|
||||
$result['license_cert_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
// 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
if ($doctor['idcard_status'] != 1) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请先实名认证");
|
||||
}
|
||||
|
||||
// 医师资格证
|
||||
if ($doctor_iden_fail['field_name'] == "qualification_cert") {
|
||||
$result['qualification_cert_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
if ($doctor['iden_auth_status'] != 3){
|
||||
return success(null);
|
||||
}
|
||||
|
||||
// 医师工作证
|
||||
if ($doctor_iden_fail['field_name'] == "work_cert") {
|
||||
$result['work_cert_reason'] = $doctor_iden_fail['fail_reason'];
|
||||
}
|
||||
}
|
||||
// 个人简介审核状态(0:未审核 1:审核通过 2:审核中 3:审核失败)
|
||||
if ($doctor['introduction_status'] != 3){
|
||||
return success(null);
|
||||
}
|
||||
|
||||
// 获取认证失败字段
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor['doctor_id'];
|
||||
$doctor_iden_fails = DoctorIdenFail::getList($params);
|
||||
if (empty($doctor_iden_fails)){
|
||||
return success(null);
|
||||
}
|
||||
|
||||
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'] == "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'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user