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] 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); });