修改学生成绩数据模型、恢复排序、修复在线编辑成绩错误

This commit is contained in:
巴掌 committed 2021-01-06 01:22:14 +08:00
1 parent 14334a2ae5
commit 146e2b63a9
6 files changed
+52 -45

No files matched your search

+1 -1
View File
@@ -145,7 +145,7 @@ class Chengji extends BaseModel
$data[$key]['subject_id'] = $value->subjectName->id;
$data[$key]['subject_lieming'] = $value->subjectName->lieming;
}
$data[$key]['defen'] = $value->defen;
$data[$key]['defen'] = $value->defen * 1;
$data[$key]['status'] = $value->status;
$data[$key]['update_time'] = $value->update_time;
+2 -2
View File
@@ -198,9 +198,9 @@ class TongjiBj extends BaseModel
// 获取并统计各班级成绩
$data = array();
$cj = $more->srcChengjiList($src);
if (array_key_exists($lieming, $cj[0]))
if (array_key_exists($lieming . 'defen', $cj[0]))
{
$cjcol = array_column($cj, $lieming);
$cjcol = array_column($cj, $lieming . 'defen');
$cjcol = array_filter($cjcol, function($item){
return $item !== null;
});
+10 -6
View File
@@ -96,8 +96,8 @@
tjxm = eval(decodeURIComponent(tjxm));
$.each(xk,function(index,value){
options.cols[0].push({field: value.lieming, title: value.title , minWidth:120,sort: true,edit:'text',templet:function(d){
var str = d[value.lieming].defen;
options.cols[0].push({field:value.lieming + 'defen', title: value.title , minWidth:120,sort: true,edit:'text',templet:function(d){
var str = d[value.lieming + 'defen'];
if(str == null)
{
str = '';
@@ -105,8 +105,8 @@
return str;
}});
$.each(tjxm, function(t, val){
options.cols[0].push({field: val.biaoshi, title: value.title + val.title , minWidth:120,templet:function(d){
var str = d[value.lieming][val.biaoshi];
options.cols[0].push({field: value.lieming + val.biaoshi,sort: true, title: value.title + val.title , minWidth:120,templet:function(d){
var str = d[value.lieming + val.biaoshi];
if(str == null)
{
str = '';
@@ -188,6 +188,8 @@
,colname = obj.field
,rowdata = obj.data;
colname = colname.replace('defen', '')
// 修改服务器数据
$.ajax({
url:"/luru/index/update/"+rowdata.id,
@@ -196,12 +198,14 @@
"colname":colname,
"newdefen":newdefen
},
success:function(result,obj){
success:function(result,objs){
if(result.val == 0 || result.code==0)
{
layer.msg(result.msg,{icon:5});
}else{
// 这个地方重新赋值平均分和总分
obj.update({
val:newdefen
});
}
},
error:function(result){
Loaded 3 of 6 files, more files were not shown because too many files have changed in this diff. Show more