恢复为实时流量统计

This commit is contained in:
root
2023-10-10 01:51:50 +09:00
parent 5ad5a633a9
commit 573f534f3e
7 changed files with 174 additions and 153 deletions

View File

@ -170,16 +170,18 @@ class UserService
public function trafficFetch(array $server, string $protocol, array $data)
{
$statService = new StatisticalService();
$statService->setStartAt(strtotime(date('Y-m-d')));
$statService->setUserStats();
$statService->setServerStats();
//$statService = new StatisticalService();
//$statService->setStartAt(strtotime(date('Y-m-d')));
//$statService->setUserStats();
//$statService->setServerStats();
foreach (array_keys($data) as $userId) {
$u = $data[$userId][0];
$d = $data[$userId][1];
StatServerJob::dispatch($u, $d, $server, $protocol, 'd');
StatUserJob::dispatch($u, $d, $userId, $server, $protocol, 'd');
TrafficFetchJob::dispatch($u, $d, $userId, $server, $protocol);
$statService->statServer($server['id'], $protocol, $u, $d);
$statService->statUser($server['rate'], $userId, $u, $d);
//$statService->statServer($server['id'], $protocol, $u, $d);
//$statService->statUser($server['rate'], $userId, $u, $d);
}
}
}