diff --git a/process/Task2.php b/process/Task2.php index 8c6728d..3ed986c 100644 --- a/process/Task2.php +++ b/process/Task2.php @@ -84,7 +84,7 @@ class Task2 $phone->time += $currentTimestamp - $phone->last_time; $phone->last_time = $currentTimestamp; // 保存在线时长记录 - UserPhoneLogDao::setOnlineTimeByPhone($phone->phone, 0, $currentTimestamp); + UserPhoneLogDao::setOnlineTimeByPhone($phone->phone, 1, $currentTimestamp); $updateData[] = $phone; } //不在线 @@ -112,7 +112,7 @@ class Task2 UserPhone::whereNotIn('phone', $all_usernames) ->where('status', '!=', 2) ->update(['status' => 2,'last_time'=>$currentTimestamp]); - + UserPhone::where('status', 2)->update(['last_time'=>$currentTimestamp,'time'=>0]); // 批量查询用户信息 $phones2 = UserPhone::whereIn('phone', $usernames2)->get();