0
This commit is contained in:
1 parent
e9fea2abd1
commit
1d69b383c2
2 files changed
+51
-13
No files matched your search
@@ -72,15 +72,44 @@ class Chengji extends Base
|
||||
,'cjStudent'=>function($query){
|
||||
$query->field('id,xingming,sex');
|
||||
}
|
||||
,'cjKaoshi'=>function($query){
|
||||
$query->field('id,title');
|
||||
}
|
||||
]);
|
||||
}
|
||||
])
|
||||
->order([$src['field']=>$src['type']])
|
||||
->whereTime('update_time','-240 hours')
|
||||
->limit(200)
|
||||
->select()
|
||||
->toArray();
|
||||
->select();
|
||||
|
||||
return $cjList;
|
||||
// 重新整理成绩
|
||||
$data = array();
|
||||
foreach ($cjList as $key => $value) {
|
||||
$data[$key] = [
|
||||
'id'=>$value->id,
|
||||
'kaoshi'=>$value->cjKaohao->cjKaoshi->title,
|
||||
'kaoshiid'=>$value->cjKaohao->cjKaoshi->id,
|
||||
'school'=>$value->cjKaohao->cjSchool->jiancheng,
|
||||
'schoolid'=>$value->cjKaohao->cjSchool->paixu,
|
||||
'banji'=>$value->cjKaohao->banjiTitle,
|
||||
'banjiid'=>$value->cjKaohao->banji,
|
||||
'subject'=>$value->subjectName->title,
|
||||
'subjectid'=>$value->subjectid,
|
||||
'defen'=>$value->defen,
|
||||
'status'=>$value->status,
|
||||
'update_time'=>$value->update_time,
|
||||
];
|
||||
$value->cjKaohao->cjStudent ? $data[$key]['student']=$value->cjKaohao->cjStudent->xingming : $data[$key]['student']= '';
|
||||
}
|
||||
|
||||
// 按条件排序
|
||||
$src['type'] == 'desc' ? $src['type'] =SORT_DESC :$src['type'] = SORT_ASC;
|
||||
if(count($data)>0){
|
||||
$data = sortArrByManyField($data,$src['field'],$src['type']);
|
||||
}
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,9 +139,9 @@ class Chengji extends Base
|
||||
$chengjilist = $kh->srcChengji($src);
|
||||
|
||||
|
||||
$src['type'] == 'desc' ? $src['type'] =SORT_DESC :$src['type'] = SORT_ASC;
|
||||
|
||||
// 按条件排序
|
||||
$src['type'] == 'desc' ? $src['type'] =SORT_DESC :$src['type'] = SORT_ASC;
|
||||
if(count($chengjilist)>0){
|
||||
$chengjilist = sortArrByManyField($chengjilist,$src['field'],$src['type']);
|
||||
}
|
||||
|
||||
@@ -67,27 +67,36 @@
|
||||
// 设置列
|
||||
options.cols=[[ //表头
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field: 'kaohao_id', title: '学校',sort: false, minWidth:120,templet:function(d){
|
||||
{field: 'kaoshiid', title: '考试',sort: true, minWidth:120,templet:function(d){
|
||||
var str ='';
|
||||
if(d.cjKaohao)
|
||||
if(d.kaoshi)
|
||||
{
|
||||
str = d.cjKaohao.cjSchool.jiancheng;
|
||||
str = d.kaoshi;
|
||||
}
|
||||
return str;
|
||||
}},
|
||||
{field: 'kaohao_id', title: '班级',sort: false,templet:function(d){
|
||||
{field: 'schoolid', title: '学校',sort: true, minWidth:70,templet:function(d){
|
||||
var str ='';
|
||||
if(d.school)
|
||||
{
|
||||
str = d.school;
|
||||
}
|
||||
return str;
|
||||
}},
|
||||
{field: 'banjiid', title: '班级',sort: true,templet:function(d){
|
||||
var str='';
|
||||
if(d.cjKaohao)
|
||||
if(d.banji)
|
||||
{
|
||||
str = d.cjKaohao.banjiTitle;
|
||||
str = d.banji;
|
||||
}
|
||||
return str;
|
||||
}},
|
||||
{field: 'student', title: '姓名',sort: true},
|
||||
{field: "subjectid",title: '学科',sort: true,templet:function(d){
|
||||
var str='';
|
||||
if(d.subjectName)
|
||||
if(d.subject)
|
||||
{
|
||||
str = d.subjectName.title;
|
||||
str = d.subject;
|
||||
}
|
||||
return str;
|
||||
}},
|
||||
|
||||
Reference in new issue
Block a user