From 15f899eadcb337ec2795b8d4e7a2ce4eec818046 Mon Sep 17 00:00:00 2001 From: sa0ChunLuyu Date: Sat, 19 Oct 2024 13:38:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E4=BD=93=E6=A3=80?= =?UTF-8?q?=E5=BC=95=E5=AF=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/API/H5/FenzhenController.php | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/H5/FenzhenController.php b/Laravel/app/Http/Controllers/API/H5/FenzhenController.php index 44c9878..58f383e 100644 --- a/Laravel/app/Http/Controllers/API/H5/FenzhenController.php +++ b/Laravel/app/Http/Controllers/API/H5/FenzhenController.php @@ -51,38 +51,40 @@ class FenzhenController extends Controller $clinic_map[] = $item['name']; } $last_time = strtotime('2024-10-10 ' . $time_line[count($time_line) - 1]['time'] . ':00'); - $push_end = false; - foreach ($clinics as $key => $item) { - if (!in_array($item['name'], $clinic_map)) { - $push_end = true; - $item_count = $item['count']; + if (!$res['data']['queue']) { + $push_end = false; + foreach ($clinics as $item) { + if (!in_array($item['name'], $clinic_map)) { + $push_end = true; + $item_count = $item['count']; + $in_time = date('H:i', $last_time); + $time_line = array_merge(array_splice($time_line, 0, count($time_line) - 1), [ + [ + "desc" => "预计 $in_time 进入队列", + "more" => 0, + "name" => $item['name'], + "status" => 1, + "time" => "$in_time", + "tip" => "剩余{$item_count}项正在排队中," + ] + ], [$time_line[count($time_line) - 1]]); + $last_time = $last_time + (60 * 5); + } + } + if ($push_end) { $in_time = date('H:i', $last_time); $time_line = array_merge(array_splice($time_line, 0, count($time_line) - 1), [ [ - "desc" => "预计 $in_time 进入队列", + "desc" => "结束时间 $in_time", "more" => 0, - "name" => $item['name'], - "status" => 1, + "name" => "体检结束", + "status" => -1, "time" => "$in_time", - "tip" => "剩余{$item_count}项正在排队中," + "tip" => "" ] - ], [$time_line[count($time_line) - 1]]); - $last_time = $last_time + (60 * 5); + ]); } } - if ($push_end) { - $in_time = date('H:i', $last_time); - $time_line = array_merge(array_splice($time_line, 0, count($time_line) - 1), [ - [ - "desc" => "结束时间 $in_time", - "more" => 0, - "name" => "体检结束", - "status" => -1, - "time" => "$in_time", - "tip" => "" - ] - ]); - } $check_report_status = -1; if (!!$res['data']['report']) { $report_time = strtotime($res['data']['report'] . ' 00:00:00') + (60 * 60 * 24 * $report_day);