diff --git a/app/chengji/common.php b/app/chengji/common.php index 1af12857..d48d665a 100644 --- a/app/chengji/common.php +++ b/app/chengji/common.php @@ -51,4 +51,9 @@ function manfenvalidate($defen,$manfen) +// 统计结果整理 + + + + diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index 85e4efc0..8a4ac05c 100644 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -12,10 +12,11 @@ class Bjtongji extends BaseController // 年级成绩汇总 public function biaoge($kaoshi) { + // 获取考试信息 $ks = new \app\kaoshi\model\Kaoshi; $ksinfo = $ks->where('id',$kaoshi) ->with([ - 'KsNianji' + 'ksNianji' ,'ksSubject'=>function($query){ $query->field('kaoshiid,subjectid,manfen') ->with(['subjectName'=>function($q){ @@ -26,13 +27,11 @@ class Bjtongji extends BaseController ]) ->field('id,title') ->find(); - - if(count($ksinfo->ksNianji)>0) - { - $list['nianji'] = $ksinfo->ksNianji[0]->nianji; - }else{ - $list['nianji'] = "一年级"; - } + // 获取参与学校 + $kh = new \app\kaoshi\model\Kaohao; + $src['kaoshi'] = $kaoshi; + $list['school'] = $kh->cySchool($src); + $list['nianji'] = $ksinfo->ksNianji->toArray(); $list['subject'] = $ksinfo->ksSubject->toArray(); // 设置要给模板赋值的信息 $list['webtitle'] = '各年级的班级成绩列表'; @@ -40,6 +39,8 @@ class Bjtongji extends BaseController $list['kaoshititle'] = $ksinfo->title; $list['dataurl'] = '/chengji/bjtj/data'; + // halt($list); + // 模板赋值 $this->view->assign('list',$list); @@ -65,15 +66,15 @@ class Bjtongji extends BaseController $src['school'] = strToarray($src['school']); + $src['ruxuenian'] = strToarray($src['ruxuenian']); // 获取参与考试的班级 $kh = new \app\kaoshi\model\Kaohao; - $src['banji']= $kh->cyBanji($src); - + $src['banji']= array_column($kh->cyBanji($src),'id'); // 统计成绩 $btj = new BTJ; - $data = $btj->tjBanji($src); + $data = $btj->search($src); // 获取记录总数 @@ -284,9 +285,6 @@ class Bjtongji extends BaseController $data == true ? $data=['msg'=>'各班级成绩统计完成','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0]; return json($data); - - - } diff --git a/app/chengji/controller/Njtongji.php b/app/chengji/controller/Njtongji.php index ca6fa986..5fab0161 100644 --- a/app/chengji/controller/Njtongji.php +++ b/app/chengji/controller/Njtongji.php @@ -67,8 +67,11 @@ class Njtongji extends BaseController // 统计成绩 $ntj = new NTJ; - $data = $ntj->tjNianji($src); - + $data = $ntj->search($src); + $schtj = new \app\chengji\model\TongjiSch; + $dataAll = $schtj->search($src); + $data[] = $dataAll['all']; + // 获取记录数 $cnt = count($data); // 截取当前页数据 diff --git a/app/chengji/controller/Schtongji.php b/app/chengji/controller/Schtongji.php index 0cac0597..5cdd071b 100644 --- a/app/chengji/controller/Schtongji.php +++ b/app/chengji/controller/Schtongji.php @@ -7,6 +7,7 @@ use app\chengji\model\TongjiSch as SCHTJ; class Schtongji { + // 统计全区年级成绩 public function tongji() { diff --git a/app/chengji/model/Tongji.php b/app/chengji/model/Tongji.php index 2322f567..c833910e 100644 --- a/app/chengji/model/Tongji.php +++ b/app/chengji/model/Tongji.php @@ -101,22 +101,8 @@ class Tongji extends Base }]) ->find(); $data = array(); - - // 循环统计各学科成绩 - foreach ($ksinfo->ksSubject as $key => $value) { - $cjcol = array_column($cj,$value->lieming); - $stucnt = count($cjcol); - $cjcol = array_filter($cjcol,function($item){ - return $item !== null; - }); - - $temp = array(); - - if($cjcol==null) - { - $temp = [ - 'stucnt'=>$stucnt, - 'id'=>$value->subjectid, + // 设置默认值 + $tempNull = [ 'xkcnt'=>0, 'sum'=>null, 'biaozhuncha'=>null, @@ -132,9 +118,24 @@ class Tongji extends Base 'min'=>null, 'zhongshu'=>null, ]; - }else{ + + + // 循环统计各学科成绩 + foreach ($ksinfo->ksSubject as $key => $value) { + $cjcol = array_column($cj,$value->lieming); + $stucnt = count($cjcol); + $cjcol = array_filter($cjcol,function($item){ + return $item !== null; + }); + + $temp = array(); + + if($cjcol==null) + { + $temp = $tempNull; $temp['stucnt'] = $stucnt; $temp['id'] = $value->subjectid; + }else{ $temp['xkcnt'] = count($cjcol); $temp['sum'] = array_sum($cjcol); $temp['xkcnt']>0 ? $temp['avg'] = $temp['sum']/$temp['xkcnt'] : $temp['avg']=0; @@ -146,6 +147,8 @@ class Tongji extends Base $temp['min'] = min($cjcol); $temp['sifenwei'] = $this->quartile($cjcol); $temp['zhongshu'] = ''; + $temp['stucnt'] = $stucnt; + $temp['id'] = $value->subjectid; } $data['cj'][$value->lieming] = $temp; } @@ -153,45 +156,31 @@ class Tongji extends Base $temp = array(); $cjcol = array_column($cj,'sum'); - $temp['stucnt'] = count($cjcol); + $$stucnt = count($cjcol); $cjcol = array_filter($cjcol,function($item){ return $item !== null; }); - $temp['id'] = 0; - $temp['xkcnt'] = count($cjcol); # 报名人数 - $temp['sum'] = array_sum($cjcol); - $temp['sum'] = array_sum($cjcol); - $temp['xkcnt']>0 ? $temp['avg'] = $temp['sum']/$temp['xkcnt'] : $temp['avg']=0; - $temp['biaozhuncha'] = round($this->getVariance($temp['avg'], $cjcol,true),2); - $temp['avg'] = round($temp['avg'],2); - $temp['max'] = max($cjcol); - $temp['min'] = min($cjcol); - $temp['youxiu'] = null; - $temp['jige'] = null; - $temp['sifenwei'] = $this->quartile($cjcol); - $temp['zhongshu'] = ''; - $temp['rate'] = $this->rateAll($cj,$ksinfo->ks_subject); #全科及格率 + if($cjcol==null){ + $temp = $tempNull; + $temp['stucnt'] = $stucnt; + $temp['id'] = 0; + }else{ + $temp['xkcnt'] = count($cjcol); # 报名人数 + $temp['sum'] = array_sum($cjcol); + $temp['xkcnt']>0 ? $temp['avg'] = $temp['sum']/$temp['xkcnt'] : $temp['avg']=0; + $temp['biaozhuncha'] = round($this->getVariance($temp['avg'], $cjcol,true),2); + $temp['avg'] = round($temp['avg'],2); + $temp['max'] = max($cjcol); + $temp['min'] = min($cjcol); + $temp['youxiu'] = null; + $temp['jige'] = $this->rateAll($cj,$ksinfo->ks_subject); #全科及格率 + $temp['sifenwei'] = $this->quartile($cjcol); + $temp['zhongshu'] = ''; + $temp['stucnt'] = $stucnt; + $temp['id'] = 0; + } $data['cj']['all'] = $temp; - - - - - // if($data['bmcnt']>0) - // { - // $data['sum'] = array_sum($cjcol); - // $data['avg'] = round($data['sum']/$data['bmcnt'],2); - // }else{ - // $data['sum'] = ''; - // $data['avg'] = ''; - // } - // foreach ($cj as $key => $value) { - // unset($cj[$key]['avg']); - // unset($cj[$key]['sum']); - // } - // $data['rate'] = $this->rateAll($cj,$ksinfo->ks_subject); #全科及格率 - halt($data); - return $data; } diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index 9cad56a0..c12f947d 100644 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -103,20 +103,18 @@ class TongjiBj extends Base /** - * 统计指定个年级的各班级成绩 - * 统计项目参考tongji方法 + * 班级成绩统计结果查询 + * 从数据库中取出数据 * @access public * @param number $kaoshi 考试id * @param number $ruxuenian 入学年 * @return array 返回类型 */ - public function tjBanji1($srcfrom) + public function search($srcfrom) { // 初始化参数 $src = array( - 'page'=>'1', - 'limit'=>'10', 'kaoshi'=>'', 'banji'=>array(), ); @@ -129,44 +127,70 @@ class TongjiBj extends Base return array(); } - // 实例化学生成绩统计类 - $tj = new TJ; - $cj = new Chengji; + $tongjiJg = $this + ->where('kaoshi_id',$src['kaoshi']) + ->where('banji_id','in',$src['banji']) + ->field('id,banji_id,kaoshi_id') + ->with([ + 'bjBanji'=>function($query){ + $query->field('id,school,paixu') + ->with([ + 'glSchool'=>function($query){ + $query->field('id,jiancheng,paixu'); + }, + ]); + }, + 'bjJieguo'=>function($query){ + $query->field('subject_id,banji_id,chengji_cnt,avg,youxiu,jige') + ->with([ + 'bjSubject'=>function($query){ + $query->field('id,lieming,jiancheng'); + }, + ]) + ->order(['subject_id']); + } + ]) + ->group('banji_id') + ->append(['banjiTitle']) + ->select(); - // 获取并统计各班级成绩 + // halt($tongjiJg->toArray()); + + // 初始化数组 $data = array(); - foreach ($src['banji'] as $key => $value) { - - $srcfrom = [ - 'kaoshi'=>$src['kaoshi'], - 'banji'=>[$value['id']] + + // 重组数据 + foreach ($tongjiJg as $key => $value) { + $data[$value->banji_id]=[ + 'id'=>$value->id, + 'school'=>$value->bjBanji->glSchool->jiancheng, + 'schoolpaixu'=>$value->bjBanji->glSchool->paixu, + 'title'=>$value->banjiTitle, + 'banjipaixu'=>$value->bjBanji->paixu, ]; - - $temp = $cj->search($srcfrom); - $temp = $tj->tongji($temp,$srcfrom['kaoshi']); - - $data[] = [ - 'banji'=>$value['banjiTitle'], - 'banjinum'=>$value['banjiNum'], - 'school'=>$value['glSchool']['jiancheng'], - 'chengji'=>$temp - ]; - + foreach ($value->bjJieguo as $k => $val) { + if($val->subject_id>0){ + $data[$value->banji_id]['chengji'][$val->bjSubject->lieming] = [ + 'avg'=>$val->avg, + 'youxiu'=>$val->youxiu, + 'jige'=>$val->jige, + 'cj_cnt'=>$val->chengji_cnt, + ]; + }else{ + $data[$value->banji_id]['quanke'] = [ + 'avg'=>$val->avg, + 'jige'=>$val->jige, + ]; + } + + } } - $srcfrom['banji'] = array_column($src['banji'], 'id'); - // 获取年级成绩 - // $allcj = $tj->srcChengji($kaoshi=$kaoshi,$banji=$bjs,$nianji=$nianji,$school=array()); - $allcj = $cj->search($srcfrom); - $temp = $tj->tongji($allcj,$srcfrom['kaoshi']); - $data[] = [ - 'banji'=>'合计', - 'banjinum'=>'合计', - 'school'=>'合计', - 'chengji'=>$temp - ]; + $data = sortArrByManyField($data,'schoolpaixu',SORT_ASC,'banjipaixu',SORT_ASC); + + return $data; @@ -183,7 +207,7 @@ class TongjiBj extends Base // 班级关联 public function bjBanji() { - return $this->belongsTo('\app\teach\model\Banji','kaoshi_id','id'); + return $this->belongsTo('\app\teach\model\Banji','banji_id','id'); } // 学科关联 @@ -191,5 +215,24 @@ class TongjiBj extends Base { return $this->belongsTo('\app\teach\model\Subject','subject_id','id'); } + + // 成绩统计结果关联 + public function bjJieguo() + { + return $this->hasMany('\app\chengji\model\TongjiBj','banji_id','banji_id'); + } + + + // 获取班级名称 + public function getBanjiTitleAttr() + { + $bfdate = \app\kaoshi\model\Kaoshi::where('id',$this->getAttr('kaoshi_id')) + ->value('bfdate'); + + $banji = new \app\teach\model\Banji; + $title = $banji->myBanjiTitle($this->getAttr('banji_id'),$bfdate); + + return $title; + } } diff --git a/app/chengji/model/TongjiNj.php b/app/chengji/model/TongjiNj.php index c9111346..ea767945 100644 --- a/app/chengji/model/TongjiNj.php +++ b/app/chengji/model/TongjiNj.php @@ -55,7 +55,7 @@ class TongjiNj extends Base ]; $temp = $kh->srcChengji($src); $temp = $tj->tongjiSubject($temp,$kaoshi); - foreach ($temp as $k => $cj) { + foreach ($temp['cj'] as $k => $cj) { // 查询该班级该学科成绩是否存在 $tongjiJg = $this->where('kaoshi_id',$src['kaoshi']) ->where('school_id',$school['school']) @@ -110,7 +110,7 @@ class TongjiNj extends Base } } - + return true; } @@ -121,72 +121,95 @@ class TongjiNj extends Base /** - * 统计各学校的指定个年级的成绩 - * 统计项目参考tongji方法 + * 年级成绩统计结果查询 + * 从数据库中取出数据 * @access public * @param number $kaoshi 考试id * @param number $ruxuenian 入学年 * @return array 返回类型 */ - public function tjNianji1($srcfrom) + public function search($srcfrom) { + // 初始化参数 $src = array( - 'page'=>'1', - 'limit'=>'10', 'kaoshi'=>'', - 'ruxuenian'=>'', + 'ruxuenian'=>array(), ); - // 用新值替换初始值 $src = array_cover( $srcfrom , $src ) ; - $data = array(); - if(strlen($src['ruxuenian']) == 0){ - return $data; - } + $ruxuenian = $src['ruxuenian']; + + // 查询要统计成绩的学校 $kh = new \app\kaoshi\model\Kaohao; - $school = $kh->cySchool($src); + $schoolList = $kh->cySchool($src); - if(count($school) == 0){ + + if(count($schoolList) == 0){ return array(); } - // 实例化学生成绩统计类 - $tj = new TJ; + + $tongjiJg = $this + ->where('kaoshi_id',$src['kaoshi']) + ->where('ruxuenian',$src['ruxuenian']) + ->field('id,kaoshi_id,school_id,ruxuenian') + ->with([ + 'njSchool'=>function($query){ + $query->field('id,paixu,jiancheng'); + }, + 'njJieguo'=>function($query) use($ruxuenian){ + $query->field('subject_id,school_id,ruxuenian,chengji_cnt,avg,youxiu,jige') + ->where('ruxuenian',$ruxuenian) + ->with([ + 'njSubject'=>function($query){ + $query->field('id,lieming,jiancheng'); + }, + ]) + ->order(['subject_id']); + } + + ]) + ->group('school_id') + ->select(); - // 获取并统计各班级成绩 + // 初始化数组 $data = array(); - $srcfrom = [ - 'kaoshi'=>$src['kaoshi'] - ,'ruxuenian'=>$src['ruxuenian'] - ]; - foreach ($school as $key => $value) { - $srcfrom['school'] = [$value['school']]; - $srcfrom['banji'] = array_column($kh->cyBanji($srcfrom), 'id'); - $temp = $kh->srcChengji($srcfrom); - $temp = $tj->tongji($temp,$src['kaoshi']); - $data[] = [ - 'school'=>$value['cjSchool']['jiancheng'], - 'chengji'=>$temp + // 重组数据 + foreach ($tongjiJg as $key => $value) { + $data[$value->school_id]=[ + 'id'=>$value->id, + 'school'=>$value->njSchool->jiancheng, + 'schoolpaixu'=>$value->njSchool->paixu, + // 'title'=>$value->banjiTitle, + // 'banjipaixu'=>$value->bjBanji->paixu, ]; + foreach ($value->njJieguo as $k => $val) { + if($val->subject_id>0){ + $data[$value->school_id]['chengji'][$val->njSubject->lieming] = [ + 'avg'=>$val->avg, + 'youxiu'=>$val->youxiu, + 'jige'=>$val->jige, + 'cj_cnt'=>$val->chengji_cnt, + ]; + }else{ + $data[$value->school_id]['quanke'] = [ + 'avg'=>$val->avg, + 'jige'=>$val->jige, + ]; + } + + } } + $data = sortArrByManyField($data,'schoolpaixu',SORT_ASC); - // 获取年级成绩 - $srcfrom['school'] = array_column($school, 'school'); - $srcfrom['banji'] = array_column($kh->cyBanji($srcfrom), 'id'); - $allcj = $kh->srcChengji($srcfrom); - $temp = $tj->tongji($allcj,$src['kaoshi']); - $data[] = [ - 'school'=>'合计', - 'chengji'=>$temp - ]; return $data; } @@ -208,4 +231,10 @@ class TongjiNj extends Base { return $this->belongsTo('\app\teach\model\Subject','subject_id','id'); } + + // 成绩统计结果关联 + public function njJieguo() + { + return $this->hasMany('\app\chengji\model\TongjiNj','school_id','school_id'); + } } diff --git a/app/chengji/model/TongjiSch.php b/app/chengji/model/TongjiSch.php index e85f81e5..6dbbb5c8 100644 --- a/app/chengji/model/TongjiSch.php +++ b/app/chengji/model/TongjiSch.php @@ -49,7 +49,7 @@ class TongjiSch extends Base ]; $temp = $kh->srcChengji($src); $temp = $tj->tongjiSubject($temp,$kaoshi); - foreach ($temp as $k => $cj) { + foreach ($temp['cj'] as $k => $cj) { // 查询该班级该学科成绩是否存在 $tongjiJg = $this->where('kaoshi_id',$src['kaoshi']) ->where('ruxuenian',$nianji->nianji) @@ -103,4 +103,92 @@ class TongjiSch extends Base return true; } + + + /** + * 年级成绩统计结果查询 + * 从数据库中取出数据 + * @access public + * @param number $kaoshi 考试id + * @param number $ruxuenian 入学年 + * @return array 返回类型 + */ + public function search($srcfrom) + { + + // 初始化参数 + $src = array( + 'kaoshi'=>'', + 'ruxuenian'=>'', + ); + + // 用新值替换初始值 + $src = array_cover( $srcfrom , $src ) ; + + + $tongjiJg = $this + ->where('kaoshi_id',$src['kaoshi']) + ->where('ruxuenian',$src['ruxuenian']) + ->field('id,kaoshi_id,ruxuenian') + ->with([ + 'schJieguo'=>function($query){ + $query->field('subject_id,ruxuenian,chengji_cnt,avg,youxiu,jige') + ->with([ + 'schSubject'=>function($query){ + $query->field('id,lieming,jiancheng'); + }, + ]) + ->order(['subject_id']); + } + + ]) + ->group('ruxuenian') + ->select(); + + + + // 初始化数组 + $data = array(); + + // 重组数据 + foreach ($tongjiJg as $key => $value) { + $data['all']=[ + 'id'=>$value->id, + 'school'=>'全区', + 'schoolpaixu'=>999, + ]; + foreach ($value->schJieguo as $k => $val) { + if($val->subject_id>0){ + $data['all']['chengji'][$val->schSubject->lieming] = [ + 'avg'=>$val->avg, + 'youxiu'=>$val->youxiu, + 'jige'=>$val->jige, + 'cj_cnt'=>$val->chengji_cnt, + ]; + }else{ + $data['all']['quanke'] = [ + 'avg'=>$val->avg, + 'jige'=>$val->jige, + ]; + } + + } + } + + return $data; + } + + + // 学科关联 + public function schSubject() + { + return $this->belongsTo('\app\teach\model\Subject','subject_id','id'); + } + // 成绩统计结果关联 + public function schJieguo() + { + return $this->hasMany('\app\chengji\model\TongjiSch','ruxuenian','ruxuenian'); + } + + } diff --git a/app/chengji/route/chengji.php b/app/chengji/route/chengji.php index 8831c8de..2564b08d 100644 --- a/app/chengji/route/chengji.php +++ b/app/chengji/route/chengji.php @@ -61,5 +61,7 @@ Route::group('njtj', function () { // 全年级统计 Route::group('schtj', function () { + Route::rule('biaoge/','Schtongji/biaoge','get'); # 班级表格 + Route::rule('data','Schtongji/ajaxData','post'); # 扫码界面 Route::rule('tongji','Schtongji/tongji','post'); # 统计各年级成绩 }); \ No newline at end of file diff --git a/app/chengji/view/bjtongji/biaoge.html b/app/chengji/view/bjtongji/biaoge.html index dd51fbca..17ea7792 100644 --- a/app/chengji/view/bjtongji/biaoge.html +++ b/app/chengji/view/bjtongji/biaoge.html @@ -17,26 +17,19 @@
- {php} $schoollist = schlist('校级','校级',['小学','中小学']);{/php} - {volist name="schoollist" id="vo"} - + {volist name="$list.school" id="vo"} + {/volist}
- {php} - $nianji = new \app\kaoshi\model\KaoshiNianji; - $njlist = $nianji - ->where('kaoshiid',$list['kaoshi']) - ->field('nianji,nianjiname') - ->select(); - {/php} - {foreach $njlist as $key=>$vo} - - {/foreach} + {volist name="$list.nianji" id="vo"} + + {/volist}
@@ -44,7 +37,7 @@
{php} $banji = new \app\teach\model\Banji; - $njlist = array_column($njlist->toArray(),'nianji'); + $njlist = array_column($list['nianji'],'nianji'); $paixu = $banji->where('status',1) ->where('ruxuenian','in',$njlist) ->max('paixu'); @@ -84,15 +77,15 @@ // 设置列 options.cols=[[ //表头 {type:'numbers',title:'序号',rowspan:2}, - {field: 'school', title: '学校',sort: true,minWidth:80,rowspan:2}, - {field: 'banji', title: '班级',sort: true,minWidth:100,rowspan:2}, + {field: 'school', title: '学校',sort: false,minWidth:80,rowspan:2}, + {field: 'title', title: '班级',sort: false,minWidth:100,rowspan:2}, ] ,[] ]; // 获取学科 var xk = ''; xk = eval(decodeURIComponent(xk)); - var xiangmu = {xkcnt:'人数',avg:'平均分',jige:'及格率%',youxiu:'优秀率%'}; // 要显示哪些统计结果 + var xiangmu = {cj_cnt:'人数',avg:'平均分',jige:'及格率%',youxiu:'优秀率%'}; // 要显示哪些统计结果 $.each(xk,function(index,value){ options.cols[0].push({title: xk[index].subjectName.title+'('+xk[index].manfen+')',colspan:4,align:'center'}); @@ -104,6 +97,10 @@ ,minWidth:100 ,templet:function(d){ var str = d.chengji[colname][i]; + if(str == null) + { + str=''; + } return str; } }; @@ -112,11 +109,11 @@ }); }); options.cols[0].push({title: '全科及格率%',minWidth:100,rowspan:2,templet:function(d){ - var str = d.chengji.rate; + var str = d.quanke.jige; return str; }}); options.cols[0].push({ title: '总平均分',minWidth:100,rowspan:2,templet:function(d){ - var str = d.chengji.avg; + var str = d.quanke.avg; return str; }}); diff --git a/app/chengji/view/njtongji/biaoge.html b/app/chengji/view/njtongji/biaoge.html index 49d94209..fcf54302 100644 --- a/app/chengji/view/njtongji/biaoge.html +++ b/app/chengji/view/njtongji/biaoge.html @@ -63,7 +63,7 @@ // 获取学科 var xk = ''; xk = eval(decodeURIComponent(xk)); - var xiangmu = {xkcnt:'参考人数',avg:'平均分',jige:'及格率%',youxiu:'优秀率%'}; // 要显示哪些统计结果 + var xiangmu = {cj_cnt:'参考人数',avg:'平均分',jige:'及格率%',youxiu:'优秀率%'}; // 要显示哪些统计结果 $.each(xk,function(index,value){ options.cols[0].push({title: xk[index].subjectName.title+'('+xk[index].manfen+')',colspan:4,align:'center'}); @@ -75,6 +75,10 @@ ,minWidth:100 ,templet:function(d){ var str = d.chengji[colname][i]; + if(str == null) + { + str = ''; + } return str; } }; @@ -83,11 +87,11 @@ }); }); options.cols[0].push({title: '全科及格率%',minWidth:120,rowspan:2,templet:function(d){ - var str = d.chengji.rate; + var str = d.quanke.jige; return str; }}); options.cols[0].push({ title: '总平均分',minWidth:100,rowspan:2,templet:function(d){ - var str = d.chengji.avg; + var str = d.quanke.avg; return str; }}); diff --git a/app/chengji/view/schtongji/biaoge.html b/app/chengji/view/schtongji/biaoge.html new file mode 100644 index 00000000..fcf54302 --- /dev/null +++ b/app/chengji/view/schtongji/biaoge.html @@ -0,0 +1,152 @@ + +{extend name=".././view/list.html" /} +{block name="jsset"} + +{/block} +{block name="nav"} + + 考试管理 + 更多操作 + 成绩查看 + 学校成绩统计表 + {$list['kaoshititle']} + +{/block} +{block name="search"} +
+ +
+ {php} + $nianji = new \app\kaoshi\model\KaoshiNianji; + $njlist = $nianji + ->where('kaoshiid',$list['kaoshi']) + ->field('nianji,nianjiname') + ->select(); + {/php} + {foreach $njlist as $key=>$vo} + + {/foreach} +
+
+ +{/block} +{block name="table"} +
+{/block} +{block name="myjs"} + + + + + + +{/block} \ No newline at end of file diff --git a/app/kaoshi/model/Kaohao.php b/app/kaoshi/model/Kaohao.php index 668b4942..36b53042 100644 --- a/app/kaoshi/model/Kaohao.php +++ b/app/kaoshi/model/Kaohao.php @@ -334,6 +334,7 @@ class Kaohao extends Base 'paixu'=>array(), ); + // 用新值替换初始值 $src = array_cover( $srcfrom , $src ) ; $school = strToarray($src['school']); @@ -367,6 +368,7 @@ class Kaohao extends Base ->select() ->toArray(); + // 将二维数组的班级转换成一维数组 foreach ($bjids as $key => $value) { // halt($key);