fix incorrect top-5 customers in traffic overview for admins; show manual update command if webupdate is disabled

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2024-01-19 09:21:38 +01:00
parent 83047019b0
commit bc1892d4ec
3 changed files with 12 additions and 1 deletions

View File

@@ -140,6 +140,14 @@ class Traffic
$years_avail = $sel_stmt->fetchAll(\PDO::FETCH_ASSOC);
}
// sort users by total traffic
usort($users, function ($user_a, $user_b) {
if ($user_a['total'] == $user_b['total']) {
return 0;
}
return ($user_a['total'] < $user_b['total']) ? 1 : -1;
});
return [
'metrics' => $metrics,
'users' => $users,