Merge branch 'dev'
This commit is contained in:
@@ -311,21 +311,24 @@ 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) {
|
||||
$query->whereIn('inquiry_type', $inquiry_type)
|
||||
->where('inquiry_mode', 1);
|
||||
"DoctorInquiryConfig" => function ($query) use ($is_search_welfare_reception) {
|
||||
$query->where('inquiry_mode', 1);
|
||||
if (!empty($is_search_welfare_reception)){
|
||||
$query->where('inquiry_type', 3);
|
||||
$query->where('is_enable', 1);
|
||||
}
|
||||
},
|
||||
])
|
||||
->where($doctor_params)
|
||||
@@ -344,10 +347,18 @@ 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) {
|
||||
$params = array();
|
||||
$params['inquiry_mode'] = 1;// 接诊方式:图文
|
||||
$query->where($params)->whereIn('inquiry_type', $inquiry_type);
|
||||
if (!empty($is_search_welfare_reception)){
|
||||
$params['is_enable'] = 1;
|
||||
}
|
||||
|
||||
$query->where($params);
|
||||
|
||||
if (!empty($is_search_welfare_reception)){
|
||||
$query->where('inquiry_type', 3);
|
||||
}
|
||||
});
|
||||
|
||||
if (!empty($sort_order)){
|
||||
|
||||
Reference in New Issue
Block a user