修改成绩在班级位置的计算方法。

This commit is contained in:
巴掌 committed 2020-12-27 09:01:42 +08:00
1 parent fcaad42b52
commit 9e015d3a44
1 file changed
+3 -8
+3 -8
View File
@@ -210,19 +210,14 @@ class Chengji extends BaseModel
return true;
}
arsort($cj);
asort($cj);
$khids = array_keys($cj); # 获取考号即键值
$data = array(); # 新数据容器
foreach ($khids as $key => $value) {
$data[$key]['id'] = $value;
$data[$key][$col[0]] = $key +1 ;
if($key > 0 && $cj[$khids[$key-1]] == $cj[$value])
{
$data[$key][$col[0]] = $data[$key-1][$col[0]];
}
$data[$key][$col[1]] = 1 - ($data[$key][$col[0]]-1)/$cnt;
$data[$key][$col[1]] = round($data[$key][$col[1]] * 100 , 2) ;
$data[$key][$col[0]] = $cnt - $key;
$data[$key][$col[1]] = round(($key) / $cnt * 100, 2);
}
$temp = $this->saveAll($data);