From ddf6475f3003d6be76b339579bcf5c057ac90ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=BE=E6=A0=91?= Date: Wed, 8 Jan 2020 09:43:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E5=8A=A8=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/controller/Index.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/chengji/controller/Index.php b/app/chengji/controller/Index.php index 2a90dde3..f95daf3f 100644 --- a/app/chengji/controller/Index.php +++ b/app/chengji/controller/Index.php @@ -776,20 +776,21 @@ class Index extends BaseController $tj = new \app\chengji\model\Tongji; $nianji = array(); $chengjiinfo = $kh->srcChengji($src); - $temp = $tj->tongji($chengjiinfo,$src['kaoshi']); + $temp = $tj->tongjiSubject($chengjiinfo,$src['kaoshi']); + isset($colcnt) ? $colcnt = $colcnt+5 : $colcnt = 12; // 循环写出统计结果 foreach ($ks->ks_subject as $key => $value) { - $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']); - $sheet->setCellValue($colname[$colcnt].'7', $temp[$value->subject_name->lieming]['biaozhuncha']); + $sheet->setCellValue($colname[$colcnt].'3', $temp['cj'][$value->subject_name->lieming]['xkcnt']); + $sheet->setCellValue($colname[$colcnt].'4', $temp['cj'][$value->subject_name->lieming]['avg']); + $sheet->setCellValue($colname[$colcnt].'5', $temp['cj'][$value->subject_name->lieming]['youxiu']); + $sheet->setCellValue($colname[$colcnt].'6', $temp['cj'][$value->subject_name->lieming]['jige']); + $sheet->setCellValue($colname[$colcnt].'7', $temp['cj'][$value->subject_name->lieming]['biaozhuncha']); $colcnt++; } - $sheet->setCellValue($colname[$colcnt+1].'3', $temp['avg']); - $sheet->setCellValue($colname[$colcnt+2].'3', $temp['rate']); + $sheet->setCellValue($colname[$colcnt+1].'3', $temp['cj']['all']['avg']); + $sheet->setCellValue($colname[$colcnt+2].'3', $temp['cj']['all']['jige']); // 保存文件