优化成绩统计算法
This commit is contained in:
1 parent
6b1a2e731c
commit
e7175db9e1
11 files changed
+267
-271
No files matched your search
@@ -269,11 +269,11 @@ function upload($list,$file,$isSave=false)
|
||||
* */
|
||||
function arraySequence($data, $field = 'id', $sort = 'desc') {
|
||||
// 排序方式
|
||||
$sort == 'desc' ? $sort = 'SORT_DESC' : $sort = 'SORT_ASC';
|
||||
$sort == 'desc' ? $sort = SORT_DESC : $sort = SORT_ASC;
|
||||
// 获取参考列
|
||||
$column = array_column($data, $field);
|
||||
// 排序
|
||||
array_multisort($column, SORT_ASC, $data);
|
||||
array_multisort($column, $sort, $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user