From 811093045818c06ea4b44b6ce6c0645f9e9f0ab8 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 14 Jun 2022 10:04:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E6=97=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E6=9C=80=E5=90=8E=E5=9C=A8=E7=BA=BF=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/WebSocketService.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Services/WebSocketService.php b/app/Services/WebSocketService.php index 87a52e51c..f0fc9d72a 100644 --- a/app/Services/WebSocketService.php +++ b/app/Services/WebSocketService.php @@ -211,6 +211,12 @@ class WebSocketService implements WebSocketHandlerInterface /** @var WebSocket $item */ foreach ($list as $item) { $item->delete(); + if ($item->userid) { + // 离线时更新会员最后在线时间 + User::whereUserid($item->userid)->update([ + 'line_at' => Carbon::now() + ]); + } if ($item->path && str_starts_with($item->path, "/single/file/")) { $array[$item->path] = $item->path; }