记录所有人在线时长:允许 user_position_id 为空,移除记录日志时的职务判断
This commit is contained in:
@@ -278,10 +278,8 @@ class AutoSaveExp extends Command
|
||||
*/
|
||||
private function tickDutyLog(User $user, int $roomId): void
|
||||
{
|
||||
// 无论有无职务,均记录在线流水
|
||||
$activeUP = $user->activePosition;
|
||||
if (! $activeUP) {
|
||||
return;
|
||||
}
|
||||
|
||||
// ① 今日未关闭的开放日志 → 刷新时长
|
||||
$openLog = PositionDutyLog::query()
|
||||
@@ -315,7 +313,7 @@ class AutoSaveExp extends Command
|
||||
|
||||
PositionDutyLog::create([
|
||||
'user_id' => $user->id,
|
||||
'user_position_id' => $activeUP->id,
|
||||
'user_position_id' => $activeUP?->id,
|
||||
'login_at' => $loginAt,
|
||||
'ip_address' => '0.0.0.0',
|
||||
'room_id' => $roomId,
|
||||
|
||||
Reference in New Issue
Block a user