From 70cd3254167ac4e88d5ee9841630b5d9a3dfa40e Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Wed, 18 Oct 2023 11:04:53 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=BB=E7=94=9F?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/UserDoctor.php | 26 +++++++++++++++++++++----- app/Services/PatientDoctorService.php | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/Model/UserDoctor.php b/app/Model/UserDoctor.php index ff6b0c7..d38f166 100644 --- a/app/Model/UserDoctor.php +++ b/app/Model/UserDoctor.php @@ -311,21 +311,29 @@ class UserDoctor extends Model * @param array $hospital_params 医院搜索条件 * @param array $doctor_params 医生搜索条件 * @param array $doctor_expertise_params - * @param array $inquiry_type + * @param int $is_search_welfare_reception 是否搜索公益问诊 * @param string|int $sort_order * @param array $fields * @param int|null $page * @param int|null $per_page * @return array */ - public static function getInquiryDoctorPage(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [],array $inquiry_type = [1,3], string|int $sort_order = 1, array $fields = ["*"], int $page = null, ?int $per_page = 10): array + public static function getInquiryDoctorPage(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [],int $is_search_welfare_reception = 0, string|int $sort_order = 1, array $fields = ["*"], int $page = null, ?int $per_page = 10): array { $query = self::with([ "Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id", "DoctorExpertise", - "DoctorInquiryConfig" => function ($query) use ($inquiry_type) { + "DoctorInquiryConfig" => function ($query) use ($is_search_welfare_reception) { + $inquiry_type = [1,3,4]; + $is_enable = 0; + if (!empty($is_search_welfare_reception)){ + $inquiry_type = [3,4]; + $is_enable = 1; + } + $query->whereIn('inquiry_type', $inquiry_type) - ->where('inquiry_mode', 1); + ->where('inquiry_mode', 1) + ->where('is_enable', $is_enable); }, ]) ->where($doctor_params) @@ -344,9 +352,17 @@ class UserDoctor extends Model ->whereHas('DoctorExpertise', function ($query) use ($doctor_expertise_params) { $query->where($doctor_expertise_params); }) - ->whereHas('DoctorInquiryConfig', function ($query) use ($inquiry_type) { + ->whereHas('DoctorInquiryConfig', function ($query) use ($is_search_welfare_reception) { + $inquiry_type = [1,3,4]; + $is_enable = 0; + if (!empty($is_search_welfare_reception)){ + $inquiry_type = [3,4]; + $is_enable = 1; + } + $params = array(); $params['inquiry_mode'] = 1;// 接诊方式:图文 + $params['is_enable'] = $is_enable; $query->where($params)->whereIn('inquiry_type', $inquiry_type); }); diff --git a/app/Services/PatientDoctorService.php b/app/Services/PatientDoctorService.php index ec2d6f4..64b5153 100644 --- a/app/Services/PatientDoctorService.php +++ b/app/Services/PatientDoctorService.php @@ -212,7 +212,7 @@ class PatientDoctorService extends BaseService "be_good_at", ]; - $user_doctors = UserDoctor::getInquiryDoctorPage($keyword,$hospital_params, $doctor_params,$doctor_expertise_params,$inquiry_type, $sort_order, $fields,$page,$per_page); + $user_doctors = UserDoctor::getInquiryDoctorPage($keyword,$hospital_params, $doctor_params,$doctor_expertise_params,$is_search_welfare_reception, $sort_order, $fields,$page,$per_page); if (!empty($user_doctors['data'])) { foreach ($user_doctors['data'] as &$user_doctor) { From 43b4de0468fe1a29a73f3eb5368bd0bc649e6ac2 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Wed, 18 Oct 2023 11:21:17 +0800 Subject: [PATCH 2/4] 1 --- app/Model/UserDoctor.php | 8 ++++---- app/Services/PatientDoctorService.php | 23 +++++++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/app/Model/UserDoctor.php b/app/Model/UserDoctor.php index d38f166..01b36a3 100644 --- a/app/Model/UserDoctor.php +++ b/app/Model/UserDoctor.php @@ -324,10 +324,10 @@ class UserDoctor extends Model "Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id", "DoctorExpertise", "DoctorInquiryConfig" => function ($query) use ($is_search_welfare_reception) { - $inquiry_type = [1,3,4]; + $inquiry_type = [1,3]; $is_enable = 0; if (!empty($is_search_welfare_reception)){ - $inquiry_type = [3,4]; + $inquiry_type = [3]; $is_enable = 1; } @@ -353,10 +353,10 @@ class UserDoctor extends Model $query->where($doctor_expertise_params); }) ->whereHas('DoctorInquiryConfig', function ($query) use ($is_search_welfare_reception) { - $inquiry_type = [1,3,4]; + $inquiry_type = [1,3]; $is_enable = 0; if (!empty($is_search_welfare_reception)){ - $inquiry_type = [3,4]; + $inquiry_type = [3]; $is_enable = 1; } diff --git a/app/Services/PatientDoctorService.php b/app/Services/PatientDoctorService.php index 64b5153..673883e 100644 --- a/app/Services/PatientDoctorService.php +++ b/app/Services/PatientDoctorService.php @@ -186,12 +186,6 @@ class PatientDoctorService extends BaseService $doctor_params["iden_auth_status"] = 1;// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败) $doctor_params["is_bind_bank"] = 1;// 是否已绑定结算银行卡(0:否 1:是) - // 问诊类型 - $inquiry_type = [1,3,4]; - if (!empty($is_search_welfare_reception)){ - $inquiry_type = [3,4]; - } - $fields = [ "doctor_id", "user_id", @@ -243,14 +237,23 @@ class PatientDoctorService extends BaseService // 公益 $user_doctor['free_clinic_price'] = $doctor_inquiry_config['inquiry_price']; } - if ($doctor_inquiry_config['inquiry_type'] == 4 && $doctor_inquiry_config['is_enable'] == 1) { - // 问诊购药 - $user_doctor['multi_point_enable'] = 1; - } } } } + // 处理可处方字段 + $user_doctor['multi_point_enable'] = 0; + + $params = array(); + $params['doctor_id'] = $user_doctor["doctor_id"]; + $params['inquiry_type'] = 4; + $params['inquiry_mode'] = 1; + $params['is_enable'] = 1; + $result = DoctorInquiryConfig::getOne($params); + if (!empty($result)){ + $user_doctor['multi_point_enable'] = 1; + } + // 好评率-超过5个已结束的订单后展示 $user_doctor['praise_rate'] = floor($user_doctor['praise_rate'] * 0.05 * 100) / 100; // 响应时间-超过5个已结束的订单后展示 From 65a3538f81ea2cf7686df456f4b1bdf344ed2299 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Wed, 18 Oct 2023 11:28:33 +0800 Subject: [PATCH 3/4] 1 --- app/Model/UserDoctor.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Model/UserDoctor.php b/app/Model/UserDoctor.php index 01b36a3..923bacf 100644 --- a/app/Model/UserDoctor.php +++ b/app/Model/UserDoctor.php @@ -325,15 +325,15 @@ class UserDoctor extends Model "DoctorExpertise", "DoctorInquiryConfig" => function ($query) use ($is_search_welfare_reception) { $inquiry_type = [1,3]; - $is_enable = 0; if (!empty($is_search_welfare_reception)){ $inquiry_type = [3]; - $is_enable = 1; } $query->whereIn('inquiry_type', $inquiry_type) - ->where('inquiry_mode', 1) - ->where('is_enable', $is_enable); + ->where('inquiry_mode', 1); + if (!empty($is_search_welfare_reception)){ + $query->where('is_enable', 1); + } }, ]) ->where($doctor_params) @@ -354,15 +354,16 @@ class UserDoctor extends Model }) ->whereHas('DoctorInquiryConfig', function ($query) use ($is_search_welfare_reception) { $inquiry_type = [1,3]; - $is_enable = 0; if (!empty($is_search_welfare_reception)){ $inquiry_type = [3]; - $is_enable = 1; } $params = array(); $params['inquiry_mode'] = 1;// 接诊方式:图文 - $params['is_enable'] = $is_enable; + if (!empty($is_search_welfare_reception)){ + $params['is_enable'] = 1; + } + $query->where($params)->whereIn('inquiry_type', $inquiry_type); }); From e12cd67f84eccb59e16741f813f711e066a65a9a Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Wed, 18 Oct 2023 11:38:32 +0800 Subject: [PATCH 4/4] xiugai liebiao --- app/Model/UserDoctor.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/app/Model/UserDoctor.php b/app/Model/UserDoctor.php index 923bacf..3515e15 100644 --- a/app/Model/UserDoctor.php +++ b/app/Model/UserDoctor.php @@ -324,14 +324,9 @@ class UserDoctor extends Model "Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id", "DoctorExpertise", "DoctorInquiryConfig" => function ($query) use ($is_search_welfare_reception) { - $inquiry_type = [1,3]; - if (!empty($is_search_welfare_reception)){ - $inquiry_type = [3]; - } - - $query->whereIn('inquiry_type', $inquiry_type) - ->where('inquiry_mode', 1); + $query->where('inquiry_mode', 1); if (!empty($is_search_welfare_reception)){ + $query->where('inquiry_type', 3); $query->where('is_enable', 1); } }, @@ -353,18 +348,17 @@ class UserDoctor extends Model $query->where($doctor_expertise_params); }) ->whereHas('DoctorInquiryConfig', function ($query) use ($is_search_welfare_reception) { - $inquiry_type = [1,3]; - if (!empty($is_search_welfare_reception)){ - $inquiry_type = [3]; - } - $params = array(); $params['inquiry_mode'] = 1;// 接诊方式:图文 if (!empty($is_search_welfare_reception)){ $params['is_enable'] = 1; } - $query->where($params)->whereIn('inquiry_type', $inquiry_type); + $query->where($params); + + if (!empty($is_search_welfare_reception)){ + $query->where('inquiry_type', 3); + } }); if (!empty($sort_order)){