From 2d7add0220b81211a993b8ee0db6cf7eebd8a99c Mon Sep 17 00:00:00 2001 From: cxdbz Date: Sun, 5 May 2019 21:10:15 +0800 Subject: [PATCH] 0 --- application/chengji/controller/Index.php | 4 +-- application/chengji/view/index/index.html | 32 +++-------------------- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/application/chengji/controller/Index.php b/application/chengji/controller/Index.php index d3e45015..fc40e3aa 100644 --- a/application/chengji/controller/Index.php +++ b/application/chengji/controller/Index.php @@ -179,7 +179,7 @@ class Index extends Base if($cj){ $cj->delete(true); } - Chengji::create([ + $data = Chengji::create([ 'kaohao_id'=>$value[1], 'subject_id'=>$val, 'user_id'=>$user_id, @@ -189,7 +189,7 @@ class Index extends Base } // 判断成绩更新结果 - empty($cj) ? $data=['msg'=>'上传失败','val'=>0] : $data=['msg'=>'上传成功','val'=>1]; + empty($data) ? $data=['msg'=>'上传失败','val'=>0] : $data=['msg'=>'上传成功','val'=>1]; ob_flush(); flush(); diff --git a/application/chengji/view/index/index.html b/application/chengji/view/index/index.html index a236ed34..839071ff 100644 --- a/application/chengji/view/index/index.html +++ b/application/chengji/view/index/index.html @@ -88,8 +88,9 @@ layui.use(['table','laypage','form','cjgl'], function(){ var table = layui.table ,form = layui.form ,cjgl = layui.cjgl - ,laypage = layui.laypage; - var mycols; + ,laypage = layui.laypage + ,mycols; + // 设置列 mycols =[ //表头 {type:'checkbox', fixed: 'left'}, {field: 'school', title: '学校',sort: true}, @@ -100,14 +101,12 @@ layui.use(['table','laypage','form','cjgl'], function(){ ]; var xk = ''; xk = eval(decodeURIComponent(xk)); - for(x in xk) { - // console.log(xk[x]); mycols.push({field: xk[x].subject_name.lieming, title: xk[x].subject_name.jiancheng ,sort: true}); } mycols.push({field: 'id', title: '操作',toolbar: '#barDemo',minWidth:140}); - + // 实例化表格 var tableIns = table.render({ @@ -123,23 +122,6 @@ layui.use(['table','laypage','form','cjgl'], function(){ cols: [mycols], }); - //执行一个laypage实例 - laypage.render({ - elem: 'test1' - ,count: 70 //数据总数,从服务端得到 - ,jump: function(obj, first){ - //obj包含了当前分页的所有参数,比如: - console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。 - console.log(obj.limit); //得到每页显示的条数 - - //首次不执行 - if(!first){ - //do something - } - } - }); - - //监听排序事件 @@ -154,12 +136,6 @@ layui.use(['table','laypage','form','cjgl'], function(){ //合并参数 var wheredata = $.extend(formval,mydata); - for(x in wheredata) - { - console.log(wheredata[x]); - } - - // 重载表格 tableIns.reload({ where: wheredata