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; }