From 8ccce4f9aa6c0d1619510726dab7ec810f6cdd44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=93=9C=E5=93=A5?= Date: Thu, 15 Jul 2021 07:46:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=A8=E7=A7=91=E5=8F=8A?= =?UTF-8?q?=E6=A0=BC=E9=94=99=E8=AF=AF=E5=92=8C=E5=AD=A6=E7=94=9F=E6=95=B0?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/model/Tongji.php | 8 +++----- app/chengji/model/TongjiBj.php | 2 ++ app/index/controller/Index.php | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) 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)