From 15dfe8d87f42828ac839ae1833531299fbedf30c Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Thu, 23 Nov 2023 13:47:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=8E=A8=E8=8D=90=E5=8C=BB?= =?UTF-8?q?=E7=94=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/UserDoctor.php | 16 +++++++++------- app/Services/PatientDoctorService.php | 6 ++++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/Model/UserDoctor.php b/app/Model/UserDoctor.php index a5652bc..405ff9a 100644 --- a/app/Model/UserDoctor.php +++ b/app/Model/UserDoctor.php @@ -81,6 +81,14 @@ class UserDoctor extends Model return $this->hasOne(Hospital::class, 'hospital_id', 'hospital_id'); } + /** + * 关联用户表 + */ + public function User(): HasOne + { + return $this->hasOne(User::class, 'user_id', 'user_id'); + } + /** * 关联问诊配置表(一对多) * @return HasMany @@ -108,13 +116,6 @@ class UserDoctor extends Model return $this->hasMany(OrderInquiry::class, "doctor_id", "doctor_id"); } -// /** -// * 关联职称表 -// */ -// public function BasicDoctorTitle(): HasOne -// { -// return $this->hasOne(BasicDoctorTitle::class, 'doctor_title_id', 'doctor_title_id'); -// } /** * 获取医生信息-单条 @@ -189,6 +190,7 @@ class UserDoctor extends Model $datas = self::with([ 'Hospital:hospital_id,hospital_name,hospital_level_name', "DoctorInquiryConfig", + "User" ]) ->where($params) ->orderBy("is_recommend", "desc") diff --git a/app/Services/PatientDoctorService.php b/app/Services/PatientDoctorService.php index 673883e..170d436 100644 --- a/app/Services/PatientDoctorService.php +++ b/app/Services/PatientDoctorService.php @@ -739,7 +739,6 @@ class PatientDoctorService extends BaseService "doctor_title", "department_custom_name", "hospital_id", - "is_online", "be_good_at", ]; @@ -758,12 +757,15 @@ class PatientDoctorService extends BaseService $data['avatar'] = addAliyunOssWebsite($recommend_doctor['avatar']); $data['doctor_title'] = empty($recommend_doctor['doctor_title']) ? "" : DoctorTitleCode::getMessage($recommend_doctor['doctor_title']); $data['department_custom_name'] = $recommend_doctor['department_custom_name']; - $data['is_online'] = $recommend_doctor['is_online']; $data['be_good_at'] = $recommend_doctor['be_good_at']; $data['hospital_name'] = $recommend_doctor['Hospital']['hospital_name'] ?? ""; $data['hospital_level_name'] = $recommend_doctor['Hospital']['hospital_level_name'] ?? ""; $data['multi_point_enable'] = 0; // 是否开启问诊购药 + if (!empty($recommend_doctor['user'])){ + $data['is_online'] = $recommend_doctor['user']['is_online']; + } + // 处理接诊价格 $data['price'] = 0; $data['free_clinic_price'] = 0;