修改医生列表
This commit is contained in:
parent
0b9005b4c4
commit
7dd3c5cac0
@ -202,6 +202,108 @@ class UserDoctor extends Model
|
||||
return $datas;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取问诊医生列表
|
||||
// * 专家问诊-公益问诊共用
|
||||
// * @param string $keyword
|
||||
// * @param array $hospital_params 医院搜索条件
|
||||
// * @param array $doctor_params 医生搜索条件
|
||||
// * @param array $doctor_expertise_params
|
||||
// * @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 = [], 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 ($sort_order) {
|
||||
// $query->whereIn('inquiry_type', [1, 3])
|
||||
// ->where('inquiry_mode', 1);
|
||||
// },
|
||||
// ])
|
||||
// ->where($doctor_params)
|
||||
// ->when($keyword, function ($query, $keyword) {
|
||||
// $query->where(function ($query) use ($keyword) {
|
||||
// $query->orwhere("user_name", 'like', '%' . $keyword . '%');
|
||||
// $query->orwhere("department_custom_name", 'like', '%' . $keyword . '%');
|
||||
// $query->orWhereHas('Hospital', function ($query) use ($keyword) {
|
||||
// $query->where('hospital_name', 'like', '%' . $keyword . '%');
|
||||
// });
|
||||
// });
|
||||
// })
|
||||
// ->whereHas('Hospital', function ($query) use ($hospital_params) {
|
||||
// $query->where($hospital_params);
|
||||
// })
|
||||
// ->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]);
|
||||
// });
|
||||
//
|
||||
// if (!empty($sort_order)){
|
||||
// if (in_array($sort_order,[1,3,4])){
|
||||
// $query = $query->join('doctor_inquiry_config', function ($query) {
|
||||
// $query->on('user_doctor.doctor_id', '=', 'doctor_inquiry_config.doctor_id')
|
||||
// ->whereIn('inquiry_type', [1, 3])
|
||||
// ->where('inquiry_mode', 1)
|
||||
// ->orderBy('inquiry_price', 'desc')
|
||||
// ->take(1);
|
||||
// })
|
||||
// ->select("user_doctor.*")
|
||||
// ->groupBy("user_doctor.doctor_id");
|
||||
// }
|
||||
//
|
||||
// if ($sort_order == 1) {
|
||||
// // 综合-价格从低到高
|
||||
// $query->orderBy('is_recommend', 'desc');// 是否首页推荐(0:否 1:是)
|
||||
// $query->orderByRaw('avg_response_time = 0 ASC');
|
||||
// $query->orderBy('avg_response_time');
|
||||
// $query->orderBy('served_patients_num', 'desc');// 服务数从多到少
|
||||
// $query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
// $query->orderBy('doctor_inquiry_config.inquiry_price', 'asc');
|
||||
// } elseif ($sort_order == 2) {
|
||||
// // 响应时间快
|
||||
// $query->orderByRaw('avg_response_time = 0 ASC');
|
||||
// $query->orderBy('avg_response_time');
|
||||
// $query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
// } elseif ($sort_order == 3) {
|
||||
// // 价格从低到高
|
||||
// $query->orderBy('doctor_inquiry_config.inquiry_price', 'asc');
|
||||
// $query->orderByRaw('avg_response_time = 0 ASC');
|
||||
// $query->orderBy('avg_response_time');
|
||||
// $query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
// } elseif ($sort_order == 4) {
|
||||
// // 价格从高到低
|
||||
// $query->orderBy('doctor_inquiry_config.inquiry_price', 'desc');
|
||||
// $query->orderByRaw('avg_response_time = 0 ASC');
|
||||
// $query->orderBy('avg_response_time');
|
||||
// $query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
// } elseif ($sort_order == 5) {
|
||||
// // 服务数从多到少
|
||||
// $query->orderBy('served_patients_num', 'desc');
|
||||
// $query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $result = $query->paginate($per_page, $fields, "page", $page);
|
||||
//
|
||||
// $data = array();
|
||||
// $data['current_page'] = $result->currentPage();// 当前页码
|
||||
// $data['total'] = $result->total();//数据总数
|
||||
// $data['data'] = $result->items();//数据
|
||||
// $data['per_page'] = $result->perPage();//每页个数
|
||||
// $data['last_page'] = $result->lastPage();//最后一页
|
||||
//
|
||||
// return $data;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取问诊医生列表
|
||||
* 专家问诊-公益问诊共用
|
||||
@ -215,13 +317,13 @@ class UserDoctor extends Model
|
||||
* @param int|null $per_page
|
||||
* @return array
|
||||
*/
|
||||
public static function getInquiryDoctorPage(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [], 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 = [],array $inquiry_type = [1,3], 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 ($sort_order) {
|
||||
$query->whereIn('inquiry_type', [1, 3])
|
||||
"DoctorInquiryConfig" => function ($query) use ($inquiry_type) {
|
||||
$query->whereIn('inquiry_type', $inquiry_type)
|
||||
->where('inquiry_mode', 1);
|
||||
},
|
||||
])
|
||||
@ -241,10 +343,10 @@ class UserDoctor extends Model
|
||||
->whereHas('DoctorExpertise', function ($query) use ($doctor_expertise_params) {
|
||||
$query->where($doctor_expertise_params);
|
||||
})
|
||||
->whereHas('DoctorInquiryConfig', function ($query) {
|
||||
->whereHas('DoctorInquiryConfig', function ($query) use ($inquiry_type) {
|
||||
$params = array();
|
||||
$params['inquiry_mode'] = 1;// 接诊方式:图文
|
||||
$query->where($params)->whereIn('inquiry_type', [1, 3]);
|
||||
$query->where($params)->whereIn('inquiry_type', $inquiry_type);
|
||||
});
|
||||
|
||||
if (!empty($sort_order)){
|
||||
|
||||
@ -187,9 +187,9 @@ class PatientDoctorService extends BaseService
|
||||
$doctor_params["is_bind_bank"] = 1;// 是否已绑定结算银行卡(0:否 1:是)
|
||||
|
||||
// 问诊类型
|
||||
$inquiry_type = 0;
|
||||
$inquiry_type = [1,3];
|
||||
if (!empty($is_search_welfare_reception)){
|
||||
$inquiry_type = 3;
|
||||
$inquiry_type = [3];
|
||||
}
|
||||
|
||||
$fields = [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user