|
|
|
|
@ -148,14 +148,35 @@ WHERE
|
|
|
|
|
//过期的排在后面
|
|
|
|
|
$time = $p->date . ' ' . $p->end_time;
|
|
|
|
|
if ($time > $nowtime) {
|
|
|
|
|
$p->plan_enable=true;
|
|
|
|
|
$pl1[] = $p;
|
|
|
|
|
} else {
|
|
|
|
|
$p->plan_enable=false;
|
|
|
|
|
$pl2[] = $p;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
usort($pl1, function($a, $b) {
|
|
|
|
|
$timeA = $a->date . ' ' . ($a->start_time ?? $a->end_time); // 兼容性处理
|
|
|
|
|
$timeB = $b->date . ' ' . ($b->start_time ?? $b->end_time);
|
|
|
|
|
return $timeA <=> $timeB;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 取出时间最早的那一个(未过期)
|
|
|
|
|
$earliestPlan = !empty($pl1) ? $pl1[0]->id : null; //最早的号源id
|
|
|
|
|
|
|
|
|
|
$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,'zhanWeiCount'=>$zhanweiCount]);
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
'earliestPlan'=>$earliestPlan
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//开始预约占用名额
|
|
|
|
|
|