update: optimization stat user

This commit is contained in:
tokumeikoi
2022-03-29 14:57:09 +08:00
parent 20b60d553c
commit af2f6a31da
4 changed files with 16 additions and 9 deletions

View File

@ -52,7 +52,7 @@ class StatUserJob implements ShouldQueue
}
$data = StatUser::where('record_at', $recordAt)
->where('server_id', $this->server->id)
->where('server_rate', $this->server->rate)
->where('user_id', $this->userId)
->first();
if ($data) {
@ -67,8 +67,6 @@ class StatUserJob implements ShouldQueue
} else {
if (!StatUser::create([
'user_id' => $this->userId,
'server_id' => $this->server->id,
'server_type' => $this->protocol,
'server_rate' => $this->server->rate,
'u' => $this->u,
'd' => $this->d,