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 031596301b
commit 13e88f5b47
3 changed files with 12 additions and 1 deletions

View File

@@ -102,6 +102,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,