修改全科及格率算法
This commit is contained in:
1 parent
6801b23dfd
commit
d090caba74
2 files changed
+4
-3
No files matched your search
@@ -585,10 +585,10 @@ class Index extends Base
|
||||
$nianji = array();
|
||||
$chengjiinfo = $tj->srcChengji($list['kaoshi'],$list['banji']);
|
||||
$temp = $tj->tongji($chengjiinfo,$list['kaoshi']);
|
||||
$colcnt = $colcnt+5;
|
||||
isset($colcnt) ? $colcnt = $colcnt+5 : $colcnt = 12;
|
||||
// 循环写出统计结果
|
||||
foreach ($ks->ks_subject as $key => $value) {
|
||||
$sheet->setCellValue($colname[$colcnt].'3', $temp[$value->subject_name->lieming]['cnt']);
|
||||
$sheet->setCellValue($colname[$colcnt].'3', $temp[$value->subject_name->lieming]['xkcnt']);
|
||||
$sheet->setCellValue($colname[$colcnt].'4', $temp[$value->subject_name->lieming]['avg']);
|
||||
$sheet->setCellValue($colname[$colcnt].'5', $temp[$value->subject_name->lieming]['youxiu']);
|
||||
$sheet->setCellValue($colname[$colcnt].'6', $temp[$value->subject_name->lieming]['jige']);
|
||||
|
||||
@@ -147,6 +147,7 @@ class Tongji extends Model
|
||||
public function rateAll($cj = array(), $sbj=array())
|
||||
{
|
||||
$jige = 0; # 总及格人数
|
||||
$sbjcnt = count($sbj);
|
||||
// 开始循环每个人的成绩
|
||||
foreach ($cj as $key => $value) {
|
||||
$temjige = 0; #记录学生及格的学科数
|
||||
@@ -161,7 +162,7 @@ class Tongji extends Model
|
||||
}
|
||||
}
|
||||
// 如果这个学生及格学科数等于学科总数,那么全科及格总数加1
|
||||
$temjige == count($value) && $temjige>0 ? $jige++ : $jige ;
|
||||
$temjige == $sbjcnt && $temjige>0 ? $jige++ : $jige ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user