核磁项目 禁止约11点后的号源

main
yanzai 11 months ago
parent fe73d119ac
commit c6a3e8a027

@ -107,12 +107,13 @@ class PlanController extends Controller
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0]) ->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
->where('is_vip','<>',1) ->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type]); ->whereIn('use_type',[0,$use_type]);
$comboItemsNmr=false;
if(!!$combo_id){ if(!!$combo_id){
$comboInfo=DB::table('combos')->where(['combo_id'=>$combo_id])->first(); $comboInfo=DB::table('combos')->where(['combo_id'=>$combo_id])->first();
if(!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)){ if(!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)){
$list=$list->whereBetween('time',[$comboInfo->keyue_start_time,$comboInfo->keyue_end_time]); $list=$list->whereBetween('time',[$comboInfo->keyue_start_time,$comboInfo->keyue_end_time]);
} }
$comboItemsNmr=DB::table('combo_items')->where(['combo_id'=>$combo_id])->where('name', 'like', '%磁%')->get();
} }
if(!!$personInfo){ if(!!$personInfo){
$list=$list->whereIn('sex',[0,$personInfo->sex]); $list=$list->whereIn('sex',[0,$personInfo->sex]);
@ -132,7 +133,14 @@ class PlanController extends Controller
}); });
} }
$list=$list->orderBy('time','asc')->get(); $list=$list->orderBy('time','asc')->get();
if(!!$comboItemsNmr){
//如果有核磁项目11点往后的号源不可用
foreach ($list as $key=>$item) {
if($item->time > '11:00:00' and $item->time <= '12:00:00'){
$list[$key]->status=2;
}
}
}
// 获取前后各三天的日期 // 获取前后各三天的日期
$dateTime = new DateTime($date); $dateTime = new DateTime($date);
@ -155,6 +163,9 @@ class PlanController extends Controller
if(!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)){ if(!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)){
$weeklist=$weeklist->whereBetween('time',[$comboInfo->keyue_start_time,$comboInfo->keyue_end_time]); $weeklist=$weeklist->whereBetween('time',[$comboInfo->keyue_start_time,$comboInfo->keyue_end_time]);
} }
if(!!$comboItemsNmr){
$weeklist=$weeklist->whereNotBetween('time',['11:00:00','12:00:00']);
}
} }
if(!!$personInfo){ if(!!$personInfo){
$weeklist=$weeklist->whereIn('sex',[0,$personInfo->sex]); $weeklist=$weeklist->whereIn('sex',[0,$personInfo->sex]);

Loading…
Cancel
Save