diff --git a/Laravel/app/Services/Admin/YeWu/PlanListService.php b/Laravel/app/Services/Admin/YeWu/PlanListService.php index 4de4bf5..a7451c5 100644 --- a/Laravel/app/Services/Admin/YeWu/PlanListService.php +++ b/Laravel/app/Services/Admin/YeWu/PlanListService.php @@ -18,14 +18,15 @@ class PlanListService $allDevice = [];//所有医嘱检查项目绑定的设备id $commPatientType = [];//所有医嘱共同的病人类型 + $zhanweiCount=0;//勾选的检查项目共计占多少名额 foreach ($entrustids as $key => $entrustid) { // $info = DB::table('s_list')->where(['reg_num' => $regnum, 'entrust_id' => $entrustid, 'episodeid' => $episodeid, 'is_nullify' => 0])->first(); $info = DB::table('s_list')->where(['entrust_id' => $entrustid, 'is_nullify' => 0])->first(); if (!$info) return \Yz::echoError1('没有找到对应医嘱信息:'.$entrustid); $itemInfo = DB::table('s_check_item')->where(['item_name' => $info->entrust, 'status' => 1, "is_del" => 0])->get(); if (count($itemInfo) == 0) return \Yz::echoError1('没有找到可用的检查项目信息'); - $itemInfo = $itemInfo[0]; + $zhanweiCount+=isset($itemInfo->use_seats)?$itemInfo->use_seats:0; $qudaos = explode(',', $itemInfo->reservation_method); //只判断主渠道,如果主渠道支持,则子渠道默认也支持,即使项目没绑定子渠道 if (!in_array($appointment_type, $qudaos)) return \Yz::echoError1('此检查项目不支持在当前渠道预约'); @@ -142,7 +143,7 @@ WHERE $planPatientType = explode(",", $p->patient_type); if (!empty(array_diff($commPatientType, $planPatientType))) { continue; - } + } //过期的排在后面 $time = $p->date . ' ' . $p->end_time; if ($time > $nowtime) { @@ -153,7 +154,7 @@ WHERE } $pp = array_merge($pl1, $pl2); - return \Yz::Return(true, '查询完成', ['today_date' => date("Y-m-d"), 'appointment_date' => $appointment_date, 'weekname' => Tools::GetWeekName($appointment_date), 'mainInfo' => $info, 'plan_list' => $pp]); + return \Yz::Return(true, '查询完成', ['today_date' => date("Y-m-d"), 'appointment_date' => $appointment_date, 'weekname' => Tools::GetWeekName($appointment_date), 'mainInfo' => $info, 'plan_list' => $pp,'zhanWeiCount'=>$zhanweiCount]); } //开始预约占用名额