usort($packageList, function ($a, $b) {
if ($a['sort'] == $b['sort']) { //权重相同,按id倒序
if ($a['id'] < $b['id']) {
return 1;
} else if ($a['id'] > $b['id']) {
return -1;
} else {
return 0;
}
} else if ($a['sort'] < $b['sort']) {
return 1;
} else {
return -1;
}
});