From bde4ef5a0f1f5eceffac6daa0134763099a34ee4 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Thu, 4 Sep 2025 13:01:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/UserDoctorInfo.php | 3 ++- app/Services/UserDoctorService.php | 10 ++++++++++ app/Utils/HttpRequest.php | 20 ++++++++++++++++++++ extend/Wechat/Wechat.php | 1 - 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app/Model/UserDoctorInfo.php b/app/Model/UserDoctorInfo.php index 1e5b07c..59dcb65 100644 --- a/app/Model/UserDoctorInfo.php +++ b/app/Model/UserDoctorInfo.php @@ -25,6 +25,7 @@ use Hyperf\Snowflake\Concern\Snowflake; * @property string $id_card_front 身份证正面图片 * @property string $id_card_back 身份证背面图片 * @property string $sign_image 签名图片 + * @property string $register_cert 电子注册证图片 * @property \Carbon\Carbon $created_at 创建时间 * @property \Carbon\Carbon $updated_at 修改时间 */ @@ -40,7 +41,7 @@ class UserDoctorInfo extends Model /** * The attributes that are mass assignable. */ - protected array $fillable = ['doctor_info_id', 'user_id', 'doctor_id', 'card_type', 'card_name', 'card_name_mask', 'card_num', 'card_num_mask', 'license_cert', 'qualification_cert', 'qualification_cert_num', 'work_cert', 'multi_point_images', 'id_card_front', 'id_card_back', 'sign_image', 'created_at', 'updated_at']; + protected array $fillable = ['doctor_info_id', 'user_id', 'doctor_id', 'card_type', 'card_name', 'card_name_mask', 'card_num', 'card_num_mask', 'license_cert', 'qualification_cert', 'qualification_cert_num', 'work_cert', 'multi_point_images', 'id_card_front', 'id_card_back', 'sign_image', 'register_cert', 'created_at', 'updated_at']; protected string $primaryKey = "doctor_info_id"; diff --git a/app/Services/UserDoctorService.php b/app/Services/UserDoctorService.php index 2387c99..a0a4415 100644 --- a/app/Services/UserDoctorService.php +++ b/app/Services/UserDoctorService.php @@ -2378,6 +2378,16 @@ class UserDoctorService extends BaseService $userDoctorService = new UserDoctorService(); $result['multi_point_enable'] = $userDoctorService->getDoctorMultiPointEnable($doctor_id); + // 获取医生详情数据 + $result['register_cert'] = ""; + $params = array(); + $params['doctor_id'] = $user_doctor['doctor_id']; + $user_doctor_info = UserDoctorInfo::getOne($params); + if (!empty($user_doctor_info)){ + if (!empty($user_doctor_info["register_cert"])){ + $result['register_cert'] = addAliyunOssWebsite($user_doctor_info["register_cert"]); + } + } return success($result); } diff --git a/app/Utils/HttpRequest.php b/app/Utils/HttpRequest.php index 6ccddb1..68f09c0 100644 --- a/app/Utils/HttpRequest.php +++ b/app/Utils/HttpRequest.php @@ -35,4 +35,24 @@ class HttpRequest return json_decode($response->getBody(),true); } + + /** + * 请求封装 + * post请求 + * @param string $path + * @param array $option + * @return array + * @throws GuzzleException + */ + public function getRequest(string $path, array $option = []): array + { + $response = $this->client->get($path, $option); + + if ($response->getStatusCode() != '200'){ + // 请求失败 + throw new BusinessException(HttpEnumCode::SERVER_ERROR,$response->getBody()->getContents()); + } + + return json_decode($response->getBody(),true); + } } \ No newline at end of file diff --git a/extend/Wechat/Wechat.php b/extend/Wechat/Wechat.php index edefd57..05c5ecd 100644 --- a/extend/Wechat/Wechat.php +++ b/extend/Wechat/Wechat.php @@ -231,7 +231,6 @@ class Wechat if ($response->isFailed()) { // 出错了,处理异常 $result = $response->toArray(); - dump($result); if(empty($result)){ // 返回值为空 return [];