Index: src/include/lib/Garradin/Services/Fees.php ================================================================== --- src/include/lib/Garradin/Services/Fees.php +++ src/include/lib/Garradin/Services/Fees.php @@ -40,10 +40,18 @@ if ($row->formula) { $sql = sprintf('SELECT %s FROM membres WHERE id = %d;', $row->formula, $user_id); $row->user_amount = $db->firstColumn($sql); } } + + usort($result, function ($a, $b) { + if ($a->user_amount == $b->user_amount) { + return 0; + } + + return $a->user_amount > $b->user_amount ? 1 : -1; + }); return $result; } public function listWithStats()