diff --git a/app/admin/model/Admin.php b/app/admin/model/Admin.php index 7a5a6d5a..af203eb4 100644 --- a/app/admin/model/Admin.php +++ b/app/admin/model/Admin.php @@ -161,8 +161,7 @@ class Admin extends BaseModel ->field('id') ->with([ 'glGroup'=>function($query){ - $query->where('status', 1) - ->field('title'); + $query->where('status', 1); } ]) ->find(); diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index f3102507..267cbea2 100644 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -121,13 +121,6 @@ class Bjtongji extends BaseController // 获取相关参数 ob_start(); - $khSrc = new \app\kaohao\model\Search; # 参考班级 - $src['banji_id']= array_column($khSrc->cyBanji($src), 'id'); - $btj = new BTJ; # 成绩统计结果 - $data = $btj->search($src); - $ntj = new \app\chengji\model\TongjiNj; - $dataAll = $ntj->search($src); - count($dataAll) > 0 ? $data['all'] = $dataAll[0] : $data; $ks = new \app\kaoshi\model\Kaoshi; # 参考学科 $ksinfo = $ks->where('id', $src['kaoshi_id']) ->field('id, title, bfdate, enddate') @@ -138,7 +131,14 @@ class Bjtongji extends BaseController $nianji = $njlist[$src['ruxuenian']]; $school = new \app\system\model\School; # 学校、年级信息 $schoolname = $school->where('id', 'in', $src['school_id'])->value('jiancheng'); - $tabletitle = $ksinfo->title . ' ' . $schoolname . ' ' . $nianji . '各班级成绩汇总'; + $tabletitle = $ksinfo->title . ' ' . $schoolname . $nianji . '各班级成绩汇总'; + $khSrc = new \app\kaohao\model\Search; # 参考班级 + $src['banji_id']= array_column($khSrc->cyBanji($src), 'id'); + $btj = new BTJ; # 成绩统计结果 + $data = $btj->search($src); + $ntj = new \app\chengji\model\TongjiNj; + $dataAll = $ntj->search($src); + count($dataAll) > 0 ? $data['all'] = $dataAll[0] : $data; // 将数据写入表格中 $spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet; # 创建文档 @@ -265,6 +265,7 @@ class Bjtongji extends BaseController $writer->save('php://output'); ob_flush(); flush(); + exit(); } diff --git a/app/chengji/controller/Index.php b/app/chengji/controller/Index.php index 1869ae13..0062bb81 100644 --- a/app/chengji/controller/Index.php +++ b/app/chengji/controller/Index.php @@ -405,6 +405,7 @@ class Index extends BaseController $writer->save('php://output'); ob_flush(); flush(); + exit(); } @@ -569,6 +570,7 @@ class Index extends BaseController $writer->save('php://output'); ob_flush(); flush(); + exit(); } diff --git a/app/chengji/controller/Njtongji.php b/app/chengji/controller/Njtongji.php index 860281eb..23f51e54 100644 --- a/app/chengji/controller/Njtongji.php +++ b/app/chengji/controller/Njtongji.php @@ -253,6 +253,7 @@ class Njtongji extends BaseController $writer->save('php://output'); ob_flush(); flush(); + exit(); } diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index 8bfcb4e3..1c56e73f 100644 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -277,7 +277,7 @@ class TongjiBj extends BaseModel ->where('kaoshi_id', 'in', function ($query) use ($src) { $query->name('kaoshi') ->whereTime('bfdate|enddate', 'between', [$src['bfdate'], $src['enddate']]) - ->when(count($src['xueqi']) > 0, function($q) use ($src) { + ->when(count($src['xueqi_id']) > 0, function($q) use ($src) { $q->where('xueqi_id', 'in', function($w) use ($src) { $w->name('xueqi') ->where('category_id', 'in', $src['xueqi_id']) diff --git a/app/chengji/view/bjtongji/dw_biaoge.html b/app/chengji/view/bjtongji/dw_biaoge.html index 688f7026..32078a6b 100644 --- a/app/chengji/view/bjtongji/dw_biaoge.html +++ b/app/chengji/view/bjtongji/dw_biaoge.html @@ -6,7 +6,7 @@