diff --git a/api/service/userDoctor.go b/api/service/userDoctor.go index 100d140..fefaca6 100644 --- a/api/service/userDoctor.go +++ b/api/service/userDoctor.go @@ -1171,14 +1171,16 @@ func (r *UserDoctorService) PutUserDoctorPending(doctorId int64, req requests.Pu return false, errors.New("审核失败") } - // 获取医生云证书数据 - userCaCertDao := dao.UserCaCertDao{} - maps := make(map[string]interface{}) - maps["user_id"] = userDoctor.UserId - maps["type"] = 2 - _, err = userCaCertDao.GetUserCaCert(maps) - if err != nil { - return false, errors.New("请先申请云证书") + if req.IdenAuthStatus == 1 { + // 获取医生云证书数据 + userCaCertDao := dao.UserCaCertDao{} + maps := make(map[string]interface{}) + maps["user_id"] = userDoctor.UserId + maps["type"] = 2 + _, err = userCaCertDao.GetUserCaCert(maps) + if err != nil { + return false, errors.New("请先申请云证书") + } } userDoctorData := make(map[string]interface{}) // 医生数据 @@ -1217,7 +1219,7 @@ func (r *UserDoctorService) PutUserDoctorPending(doctorId int64, req requests.Pu userDoctorData["iden_auth_time"] = time.Now().Format("2006-01-02 15:04:05") // 审核通过删除所有不通过原因数据 - maps = make(map[string]interface{}) + maps := make(map[string]interface{}) maps["doctor_id"] = doctorId err = doctorIdenFailDao.DeleteDoctorIdenFail(tx, maps) if err != nil {