|
|
|
|
@ -217,7 +217,7 @@ public function GetList(Request $request)
|
|
|
|
|
->leftJoin('s_period','s_list.reservation_time','=','s_period.id')
|
|
|
|
|
->leftJoin('s_department_resources','s_list.reservation_sources','=','s_department_resources.id')
|
|
|
|
|
->select('s_list.*','s_period.period_begin_time','s_period.period_end_time','s_department_resources.department_resources_name')
|
|
|
|
|
->where(['s_list.is_del'=>0,'s_list.is_nullify'=>0]);
|
|
|
|
|
->where(['s_list.is_del'=>0]);
|
|
|
|
|
if($userInfo[0]->group==2){
|
|
|
|
|
// $list=$list->whereIn('warddesc', explode(",", $userInfo[0]->ward));
|
|
|
|
|
$list=$list->where(['wardcode'=> $department->department_number]);
|
|
|
|
|
@ -272,8 +272,15 @@ public function GetList(Request $request)
|
|
|
|
|
$list = $list->whereBetween('s_list.reservation_date', $searchInfo['dateRange']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isset($searchInfo['list_status'])) {
|
|
|
|
|
$list = $list->where('s_list.list_status', $searchInfo['list_status']);
|
|
|
|
|
if (isset($searchInfo['list_status']) && $searchInfo['list_status'] !== '' && $searchInfo['list_status'] !== null) {
|
|
|
|
|
if ($searchInfo['list_status'] === 'nullify') {
|
|
|
|
|
$list = $list->where('s_list.is_nullify', 1);
|
|
|
|
|
} else {
|
|
|
|
|
$list = $list->where('s_list.is_nullify', 0)
|
|
|
|
|
->where('s_list.list_status', $searchInfo['list_status']);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$list = $list->where('s_list.is_nullify', 0);
|
|
|
|
|
}
|
|
|
|
|
if (isset($searchInfo['patient_type'])) {
|
|
|
|
|
$list = $list->where('s_list.patient_type', $searchInfo['patient_type']);
|
|
|
|
|
@ -303,7 +310,7 @@ public function GetList(Request $request)
|
|
|
|
|
//动态排序
|
|
|
|
|
$orderField = $searchInfo['orderField'] ?? '';
|
|
|
|
|
$orderDirection = ($searchInfo['orderDirection'] ?? '') == 'ascending' ? 'asc' : 'desc';
|
|
|
|
|
$allowedFields = ['reg_num', 'episodeid', 'user_name', 'user_sex', 'user_brithday', 'entrust', 'is_pay', 'list_status', 'reservation_department', 'user_phone', 'reservation_time', 'entrust_date_time'];
|
|
|
|
|
$allowedFields = ['reg_num', 'episodeid', 'user_name', 'user_sex', 'user_brithday', 'entrust', 'is_pay', 'list_status', 'reservation_department', 'user_phone', 'reservation_time', 'reservation_date', 'entrust_date_time'];
|
|
|
|
|
if (!empty($orderField) && in_array($orderField, $allowedFields)) {
|
|
|
|
|
if ($orderField === 'reservation_time') {
|
|
|
|
|
$list = $list->orderByRaw("CONCAT(IFNULL(s_list.reservation_date,''), ' ', IFNULL(s_period.period_begin_time,'')) $orderDirection");
|
|
|
|
|
|