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