|
|
|
|
@ -364,7 +364,7 @@ public function GetEnablePlan($regnum, $entrustids, $episodeid, $appointment_typ
|
|
|
|
|
$debugPassed[] = $p->resources_id;
|
|
|
|
|
|
|
|
|
|
//过期的排在后面
|
|
|
|
|
$time = $p->date . ' ' . $p->end_time;
|
|
|
|
|
$time = $p->date . ' ' . $p->end_reservation_time;
|
|
|
|
|
$remaining = ($p->count ?? 0) - ($p->used_count ?? 0);
|
|
|
|
|
$existingMax = $existingSharedAtPlan[$p->id] ?? 0;
|
|
|
|
|
$needed = $zhanweiCount - min($newSharedMax, $existingMax);
|
|
|
|
|
@ -430,7 +430,7 @@ public function GetEnablePlan($regnum, $entrustids, $episodeid, $appointment_typ
|
|
|
|
|
|
|
|
|
|
// 收集 earliest:仅 status=1 且 remaining>0 且未过期
|
|
|
|
|
if (($plan->status ?? 1) == 1 && $remaining > 0) {
|
|
|
|
|
$endDateTime = $plan->date . ' ' . ($plan->end_time ?? '23:59:59');
|
|
|
|
|
$endDateTime = $plan->date . ' ' . ($plan->end_reservation_time ?? '23:59:59');
|
|
|
|
|
if (strtotime($endDateTime) > $nowTimestamp) {
|
|
|
|
|
$startDateTime = $plan->date . ' ' . ($plan->begin_time ?? '00:00:00');
|
|
|
|
|
$ts = strtotime($startDateTime);
|
|
|
|
|
@ -933,7 +933,7 @@ private function getAvailablePlansForDate($regnum, $entrustids, $episodeid, $app
|
|
|
|
|
$nowtime = date('Y-m-d H:i:s');
|
|
|
|
|
$availablePlans = [];
|
|
|
|
|
foreach ($planList as $plan) {
|
|
|
|
|
$planEndTime = $plan->date . ' ' . $plan->end_time;
|
|
|
|
|
$planEndTime = $plan->date . ' ' . $plan->end_reservation_time;
|
|
|
|
|
if ($planEndTime > $nowtime && $plan->plan_enable) {
|
|
|
|
|
$availablePlans[] = $plan;
|
|
|
|
|
}
|
|
|
|
|
@ -1074,7 +1074,7 @@ public function YuYue($planid, $appointment_type, $mainlistids, $do_type,$is_eme
|
|
|
|
|
$date = new DateTime($entrust_time);
|
|
|
|
|
$date->modify("+" . $item->check_begin_time . " minutes");
|
|
|
|
|
$enableCheckTime = $date;//到此时间后可进行预约
|
|
|
|
|
$plan_dateTime = $planInfo->date . ' ' . $planInfo->end_time;
|
|
|
|
|
$plan_dateTime = $planInfo->date . ' ' . $planInfo->end_reservation_time;
|
|
|
|
|
$plan_dateTime = new DateTime($plan_dateTime);
|
|
|
|
|
if ($plan_dateTime < $enableCheckTime and $item->check_begin_time>0) return \Yz::echoError1($item->item_name . " 已设置只能预约医嘱开具后" . $item->check_begin_time . "分钟后的时间,请预约" . $enableCheckTime->format("Y-m-d H:i:s") . "之后的时间");
|
|
|
|
|
|
|
|
|
|
|