update: statistical service

This commit is contained in:
v2board
2023-04-15 19:34:54 +08:00
parent 6dd509d73e
commit 7be6553396
10 changed files with 112 additions and 5 deletions

View File

@ -50,8 +50,8 @@ class TrafficFetchJob implements ShouldQueue
$user->t = time();
$user->u = $user->u + ($this->u * $this->server['rate']);
$user->d = $user->d + ($this->d * $this->server['rate']);
if (!$user->save()) throw new \Exception('流量更新失败');
$mailService = new MailService();
$mailService->remindTraffic($user);
if (!$user->save()) {
info("流量更新失败\n未记录用户ID:{$this->userId}\n未记录上行:{$user->u}\n未记录下行:{$user->d}");
}
}
}