diff --git a/app/chengji/model/Tongji.php b/app/chengji/model/Tongji.php index fdc31fa3..af46e04f 100755 --- a/app/chengji/model/Tongji.php +++ b/app/chengji/model/Tongji.php @@ -106,7 +106,6 @@ class Tongji extends BaseModel $data['cj'][$value['lieming']] = $temp; } - $temp = $tempNull; $cjcol = array_column($cj, 'sum'); $stu_cnt = count($cjcol); @@ -123,7 +122,6 @@ class Tongji extends BaseModel $temp['defenlv'] = $temp['avg'] / $sbjdefencnt; } $temp['biaozhuncha'] = round($this->getVariance($temp['avg'], $cjcol, true), 2); - $temp['avg'] = round($temp['avg'], 2); $temp['max'] = max($cjcol); $temp['min'] = min($cjcol); @@ -172,11 +170,11 @@ class Tongji extends BaseModel $col = 0; # 记录有成绩的学生数 // 开始循环这个学生的每个学科成绩 foreach ($sbj as $k => $val) { - if (isset($value[$val['lieming']])) { - if ($value[$val['lieming']] >= $val['fenshuxian'][$category]) { + if (isset($value[$val['lieming'].'defen'])) { + if ($value[$val['lieming'].'defen'] >= $val['fenshuxian'][$category]) { $temjige ++; } - if ($value[$val['lieming']] !== null) { + if ($value[$val['lieming'].'defen'] !== null) { $col ++; } } diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index ca42b524..603d7002 100755 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -50,6 +50,7 @@ class TongjiBj extends BaseModel // 循环更新或写入成绩 foreach ($temp['cj'] as $cjkey => $cj) { + // dump($cjkey, $cj); $tongjiJg = $this->where('kaoshi_id', $src['kaoshi_id']) ->where('banji_id', $val['id']) ->where('subject_id', $cj['id']) @@ -265,6 +266,7 @@ class TongjiBj extends BaseModel ,'canshilv' => $val->canshilv ]; }else{ + // halt($val->toArray()); $data[$value->banji_id]['quanke'] = [ 'avg' => $val->avg ,'jigelv' => $val->jigelv diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 33ae47ba..63a19e87 100755 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -81,6 +81,10 @@ class Index extends AdminBase // 学生数 $con = new \app\teach\model\Banji; $tempsrc['ruxuenian'] = array_keys(\app\facade\Tools::nianJiNameList()); + $tempsrc['auth'] = [ + 'check' => false + ,'banji_id' => array() + ]; $bjids = $con->search($tempsrc)->column('id'); $con = new \app\student\model\Student; $list['student'] = $con->where('banji_id', 'in', $bjids)