Sort piggy banks

This commit is contained in:
James Cole
2024-11-03 08:56:19 +01:00
parent 7028cb1546
commit 2c1b9534f3

View File

@@ -65,6 +65,16 @@ class FrontpageController extends Controller
$info[] = $entry;
}
}
// sort by current percentage (lowest at the top)
uasort(
$info,
static function (array $a, array $b) {
return $a['percentage'] <=> $b['percentage'];
}
);
$html = '';
if (0 !== count($info)) {
try {