mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
improved secondary sort
This commit is contained in:
parent
f5f51bdebe
commit
c030c3fa18
@ -240,7 +240,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$order = ( $_GET['order'] ) ? $_GET['order'] : 'ip';
|
||||
usort($leases,
|
||||
function ($a, $b) use ($order) {
|
||||
return strnatcasecmp($a[$order].$a['ip'], $b[$order].$b['ip']);
|
||||
$cmp = strnatcasecmp($a[$order], $b[$order]);
|
||||
if ($cmp === 0) {
|
||||
$cmp = strnatcasecmp($a['ip'], $b['ip']);
|
||||
}
|
||||
return $cmp;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user