diff --git a/application/chengji/model/Tongji.php b/application/chengji/model/Tongji.php index d3679f93..135c166b 100644 --- a/application/chengji/model/Tongji.php +++ b/application/chengji/model/Tongji.php @@ -102,8 +102,13 @@ class Tongji extends Model $cnt++; } } + if(count($cj)>0) + { + return round($cnt/count($cj)*100); + }else{ + return ''; + } - return round($cnt/count($cj)*100); } @@ -115,18 +120,23 @@ class Tongji extends Model $tempcj = 0; foreach ($sbj as $k => $val) { $tempsbj = 0; - // if(isset($value[$val->lieming])) - // { + if(isset($value[$val->lieming])) + { if($value[$val->lieming]>$val->jige) { $tempsbj++; } - // } + } } $tempcj == $tempsbj ? $jige++ : $jige ; } - return round($jige/count($cj)*100); + if(count($cj)>0) + { + return round($jige/count($cj)*100); + }else{ + return ''; + } } diff --git a/application/chengji/view/tongji/tj_banji.html b/application/chengji/view/tongji/tj_banji.html index 8c1b21d7..276136ef 100644 --- a/application/chengji/view/tongji/tj_banji.html +++ b/application/chengji/view/tongji/tj_banji.html @@ -101,7 +101,7 @@ options.cols[1].push(colinfo); }); }); - options.cols[0].push({title: '全科及格率',minWidth:100,rowspan:2,templet:function(d){ + options.cols[0].push({title: '全科及格率%',minWidth:100,rowspan:2,templet:function(d){ var str = d.chengji.rate; return str; }}); diff --git a/application/chengji/view/tongji/tj_nianji.html b/application/chengji/view/tongji/tj_nianji.html index 99e8ed54..3b31c6c2 100644 --- a/application/chengji/view/tongji/tj_nianji.html +++ b/application/chengji/view/tongji/tj_nianji.html @@ -49,7 +49,7 @@ // 设置列 options.cols=[[ //表头 {type:'numbers',title:'序号',rowspan:2}, - {field: 'school', title: '学校',sort: true,minWidth:80,rowspan:2}, + {field: 'school', title: '学校',minWidth:80,rowspan:2}, ] ,[] ]; @@ -75,7 +75,7 @@ options.cols[1].push(colinfo); }); }); - options.cols[0].push({title: '全科及格率',minWidth:100,rowspan:2,templet:function(d){ + options.cols[0].push({title: '全科及格率%',minWidth:120,rowspan:2,templet:function(d){ var str = d.chengji.rate; return str; }}); diff --git a/application/common/controller/Base.php b/application/common/controller/Base.php index 62908086..2e0fa74b 100644 --- a/application/common/controller/Base.php +++ b/application/common/controller/Base.php @@ -15,7 +15,7 @@ class Base extends Controller protected $middleware = [ 'YanZheng'=>[ 'except'=>[ - 'ajaxData', + // 'ajaxData', 'exit', ], ],