mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 17:31:49 +08:00 
			
		
		
		
	update: fix statistics
This commit is contained in:
		| @@ -168,8 +168,18 @@ class UserService | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public function trafficFetch(int $u, int $d, int $userId, array $server, string $protocol) | ||||
|     public function trafficFetch(array $server, string $protocol, array $data) | ||||
|     { | ||||
|         TrafficFetchJob::dispatch($u, $d, $userId, $server, $protocol); | ||||
|         $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]; | ||||
|             TrafficFetchJob::dispatch($u, $d, $userId, $server, $protocol); | ||||
|             $statService->statServer($server['id'], $protocol, $u, $d); | ||||
|             $statService->statUser($server['rate'], $userId, $u, $d); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user