From 92966ed516752d216745e1f6f2e527160f2e79d0 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 31 Jan 2023 12:05:25 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=AD=BE=E5=88=B0?= =?UTF-8?q?=E6=89=93=E5=8D=A1=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/PublicController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Api/PublicController.php b/app/Http/Controllers/Api/PublicController.php index 94c012e69..828f54a0b 100755 --- a/app/Http/Controllers/Api/PublicController.php +++ b/app/Http/Controllers/Api/PublicController.php @@ -140,19 +140,19 @@ class PublicController extends AbstractController if ($dialog) { $hi = date("H:i"); $pre = $type == "up" ? "上班" : "下班"; - $remark = $checkin->remark ?: $checkin->mac; - $text = "{$pre}签到成功,签到时间: {$hi} ({$remark})"; + $remark = $checkin->remark ? " ({$checkin->remark})": ""; + $text = "{$pre}打卡成功,打卡时间: {$hi} {$remark}"; WebSocketDialogMsg::sendMsg(null, $dialog->id, 'text', ['text' => $text], $botUser->userid); } }; - if ($timeAdvance <= Base::time() && Base::time() <= $timeStart + 3600) { - // 上班签到(迟到1小时内仍提醒) + if ($timeAdvance <= Base::time() && Base::time() < $timeEnd) { + // 上班打卡通知(从最早打卡时间 到 下班打卡时间) foreach ($checkins as $checkin) { $sendMsg('up', $checkin); } } if ($timeEnd <= Base::time() && Base::time() <= $timeDelay) { - // 下班签到 + // 下班打卡通知(下班打卡时间 到 最晚打卡时间) foreach ($checkins as $checkin) { $sendMsg('down', $checkin); }