修改医生列表、修改上报数据
This commit is contained in:
@@ -219,13 +219,8 @@ class UserDoctor extends Model
|
||||
{
|
||||
$query = self::with([
|
||||
"Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id",
|
||||
"DoctorExpertise" => function ($query) use ($doctor_expertise_params) {
|
||||
$query->where($doctor_expertise_params);
|
||||
},
|
||||
"DoctorExpertise",
|
||||
"DoctorInquiryConfig" => function ($query) use ($sort_order) {
|
||||
$params = array();
|
||||
$params['inquiry_mode'] = 1;// 接诊方式:图文
|
||||
$query->where($params)->whereIn('inquiry_type', [1, 3]);
|
||||
if ($sort_order == 1) {
|
||||
// 综合-价格从低到高
|
||||
$query->orderBy('inquiry_price', 'asc');
|
||||
@@ -236,8 +231,6 @@ class UserDoctor extends Model
|
||||
// 价格从高到低
|
||||
$query->orderBy('inquiry_price', 'desc');
|
||||
}
|
||||
|
||||
return $query;
|
||||
},
|
||||
])
|
||||
->where($doctor_params)
|
||||
@@ -253,6 +246,14 @@ class UserDoctor extends Model
|
||||
});
|
||||
});
|
||||
})
|
||||
->whereHas('DoctorExpertise', function ($query) use ($doctor_expertise_params) {
|
||||
$query->where($doctor_expertise_params);
|
||||
})
|
||||
->whereHas('DoctorInquiryConfig', function ($query) {
|
||||
$params = array();
|
||||
$params['inquiry_mode'] = 1;// 接诊方式:图文
|
||||
$query->where($params)->whereIn('inquiry_type', [1, 3]);
|
||||
})
|
||||
->when($sort_order, function ($query, $sort_order) {
|
||||
if ($sort_order == 1) {
|
||||
$query->orderBy('is_recommend', 'desc');// 是否首页推荐(0:否 1:是)
|
||||
@@ -277,7 +278,12 @@ class UserDoctor extends Model
|
||||
$query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
}
|
||||
return $query;
|
||||
});
|
||||
})
|
||||
// ->join('doctor_inquiry_config', 'user_doctor.doctor_id', '=', 'doctor_inquiry_config.doctor_id')
|
||||
// ->groupBy("user_doctor.doctor_id")
|
||||
// ->orderBy("doctor_inquiry_config.inquiry_price",'desc')
|
||||
->select("user_doctor.*");
|
||||
|
||||
|
||||
$result = $query->paginate($per_page, $fields, "page", $page);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user