班级成绩

This commit is contained in:
cxdbz committed 2019-05-11 20:09:20 +08:00
1 parent 7db5895f6a
commit d36acc3d13
2 files changed
+13 -7

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ class Tongji extends Base
,'ksSubject'=>function($query){
$query->field('kaoshiid,subjectid')
->with(['subjectName'=>function($q){
$q->field('id,jiancheng,lieming');
$q->field('id,title,lieming');
}]
);
}
+12 -6
View File
@@ -73,32 +73,36 @@
options.url = "{:url('ajaxBianji')}";
// 设置列
options.cols=[[ //表头
{type:'numbers',title:'序号'},
{field: 'school', title: '学校',sort: true},
{field: 'banji', title: '班级',sort: true},
]];
{type:'numbers',title:'序号',rowspan:2},
{field: 'school', title: '学校',sort: true,minWidth:80,rowspan:2},
{field: 'banji', title: '班级',sort: true,minWidth:100,rowspan:2},
]
,[]
];
// 获取学科
var xk = '<?php echo json_encode($list["subject"]);?>';
xk = eval(decodeURIComponent(xk));
var xiangmu = {cnt:'人数',avg:'平均分',youxiu:'优秀率',jige:'及格率'}; // 要显示哪些统计结果
$.each(xk,function(index,value){
options.cols[0].push({title: xk[index].subject_name.title,colspan:4,align:'center'});
$.each(xiangmu,function(i,val){
var colname = xk[index].subject_name.lieming;
// console.log(colname + ' ' + i);
var colinfo = {
title:val
,sort:true
,minWidth:100
,templet:function(d){
var str = d.chengji[colname][i];
return str;
}
};
options.cols[0].push(colinfo);
options.cols[1].push(colinfo);
});
});
options.cols[0].push({ title: '总平均分',sort: true,templet:function(d){
options.cols[0].push({ title: '总平均分',sort: true,minWidth:100,rowspan:2,templet:function(d){
var str = d.chengji.avg;
return str;
}});
@@ -110,6 +114,8 @@
,nianji:"{$list.nianji}"
}
options.autoSort=true;
// 提交搜索条件后重载表格