From 6fd254bafd4cef4b1e94bd995f60ff1d967992fe Mon Sep 17 00:00:00 2001 From: cxdbz Date: Sat, 14 Dec 2019 20:22:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=88=90=E7=BB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/controller/Bjtongji.php | 10 +++---- app/chengji/controller/Index.php | 36 +++++++++++++++--------- app/chengji/controller/Njtongji.php | 6 ++-- app/chengji/controller/Tongji.php | 8 ++++-- app/chengji/route/chengji.php | 36 +++++++++++++++++++++++- app/chengji/view/index/biaolu.html | 2 +- app/chengji/view/index/deletecjs.html | 2 +- app/chengji/view/index/dw_chengji.html | 2 +- app/chengji/view/index/edit.html | 2 +- app/chengji/view/index/index.html | 16 +++++------ app/chengji/view/index/malu.html | 2 +- app/chengji/view/index/read_add.html | 12 ++++---- app/chengji/view/njtongji/biaoge.html | 2 +- app/chengji/view/njtongji/dw_nianji.html | 2 +- app/chengji/view/tongji/yilu_cnt.html | 13 ++++----- app/event/KaoshiDate.php | 8 ++++++ app/index/controller/Index.php | 4 +-- app/kaoshi/controller/Kaohao.php | 2 +- app/kaoshi/model/Kaohao.php | 8 ++++-- app/kaoshi/route/kaoshi.php | 26 ++--------------- app/kaoshi/view/index/more_action.html | 8 +++--- app/kaoshi/view/kaohao/caiji.html | 2 +- app/login/controller/Index.php | 2 +- config/app.php | 5 ---- config/shangma.php | 11 ++++++++ database/seeds/Rule.php | 6 ++-- 26 files changed, 136 insertions(+), 97 deletions(-) create mode 100644 app/event/KaoshiDate.php create mode 100644 config/shangma.php diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index 599d8447..927575cc 100644 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -10,7 +10,7 @@ use app\chengji\model\Bjtongji as BTJ; class Bjtongji extends BaseController { // 年级成绩汇总 - public function Biaoge($kaoshi) + public function biaoge($kaoshi) { $ks = new \app\kaoshi\model\Kaoshi; $ksinfo = $ks->where('id',$kaoshi) @@ -49,7 +49,7 @@ class Bjtongji extends BaseController // 获取年级成绩统计结果 - public function ajaxBianji() + public function ajaxData() { // 获取参数 $src = $this->request @@ -58,14 +58,14 @@ class Bjtongji extends BaseController 'limit'=>'10', 'kaoshi'=>'', 'nianji'=>'', - 'school'=>array(), + 'school'=>'', 'paixu'=>array(), ],'POST'); // 统计成绩 $btj = new BTJ; - $data = $btj->tjBanji($src['kaoshi'],$src['nianji'],$src['school'],$src['paixu']); + $data = $btj->tjBanji($src['kaoshi'],$src['nianji'],[$src['school']],$src['paixu']); // 获取记录总数 @@ -85,7 +85,7 @@ class Bjtongji extends BaseController } // 年级、班级学生成绩统计结果下载界面 - public function dwBanji($kaoshi) + public function dwBiaoge($kaoshi) { // 设置页面标题 $list['set'] = array( diff --git a/app/chengji/controller/Index.php b/app/chengji/controller/Index.php index 3a764a17..d38b4375 100644 --- a/app/chengji/controller/Index.php +++ b/app/chengji/controller/Index.php @@ -26,9 +26,9 @@ class Index extends BaseController // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染 - return $this->fetch(); + return $this->view->fetch(); } // 保存使用二维码录入的成绩 @@ -182,9 +182,9 @@ class Index extends BaseController ); // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染 - return $this->fetch(); + return $this->view->fetch(); } @@ -305,8 +305,9 @@ class Index extends BaseController - $list['subject'] = $ksinfo->ks_subject; + $list['subject'] = $ksinfo->ksSubject->toArray(); $list['kaoshi'] = $kaoshi; + $list['dataurl'] = '/chengji/index/data'; if(count($ksinfo->ks_nianji)>0) { $list['nianji'] = $ksinfo->ks_nianji[0]->nianji; @@ -314,11 +315,12 @@ class Index extends BaseController $list['nianji'] = "一年级"; } + // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染模板 - return $this->fetch(); + return $this->view->fetch(); } @@ -340,7 +342,9 @@ class Index extends BaseController ->column('id'); } - + $src['school'] = [$src['school']]; + + // 实例化 $kaohao = new Kaohao; @@ -348,6 +352,7 @@ class Index extends BaseController $data = $kaohao->srcChengji($src); + // 获取符合条件记录总数 $cnt = count($data); // 获取当前页数据 @@ -438,9 +443,9 @@ class Index extends BaseController $list['subject'] = $subject['ks_subject']; // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染 - return $this->fetch(); + return $this->view->fetch(); } @@ -537,9 +542,9 @@ class Index extends BaseController ); // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染 - return $this->fetch(); + return $this->view->fetch(); } @@ -697,15 +702,17 @@ class Index extends BaseController // 学生成绩录入信息 public function readAdd($kaohao) { + // 设置要给模板赋值的信息 $list['webtitle'] = '查看成绩录入信息'; $list['kaohao'] = $kaohao; + $list['dataurl'] = '/chengji/index/dataadd'; // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染模板 - return $this->fetch(); + return $this->view->fetch(); } @@ -746,6 +753,7 @@ class Index extends BaseController ]) ->select(); + $cnt = count($data); // 获取当前页数据 diff --git a/app/chengji/controller/Njtongji.php b/app/chengji/controller/Njtongji.php index 1ac58c95..480153ed 100644 --- a/app/chengji/controller/Njtongji.php +++ b/app/chengji/controller/Njtongji.php @@ -10,7 +10,7 @@ use app\chengji\model\Njtongji as NTJ; class Njtongji extends BaseController { // 获取各学校、各年级考试成绩 - public function Biaoge($kaoshi) + public function biaoge($kaoshi) { $ks = new \app\kaoshi\model\Kaoshi; @@ -51,7 +51,7 @@ class Njtongji extends BaseController // 获取年级成绩统计结果 - public function ajaxNianji() + public function ajaxData() { // 获取参数 $src = $this->request @@ -84,7 +84,7 @@ class Njtongji extends BaseController // 年级、班级学生成绩统计结果下载界面 - public function dwNianji($kaoshi) + public function dwBiaoge($kaoshi) { // 设置页面标题 diff --git a/app/chengji/controller/Tongji.php b/app/chengji/controller/Tongji.php index 981fd597..94ccb9b4 100644 --- a/app/chengji/controller/Tongji.php +++ b/app/chengji/controller/Tongji.php @@ -34,18 +34,20 @@ class Tongji extends BaseController }else{ $list['nianji'] = "一年级"; } - $list['subject'] = $ksinfo->ks_subject->toArray(); + $list['subject'] = $ksinfo->ksSubject->toArray(); // 设置要给模板赋值的信息 $list['webtitle'] = '各年级的班级成绩列表'; $list['kaoshi'] = $kaoshi; $list['kaoshititle'] = $ksinfo->title; + $list['dataurl'] = '/chengji/bjtj/data'; + // 模板赋值 - $this->assign('list',$list); + $this->view->assign('list',$list); // 渲染模板 - return $this->fetch(); + return $this->view->fetch(); } diff --git a/app/chengji/route/chengji.php b/app/chengji/route/chengji.php index 105c7025..a7160358 100644 --- a/app/chengji/route/chengji.php +++ b/app/chengji/route/chengji.php @@ -11,9 +11,43 @@ use think\facade\Route; +// 成绩管理 +Route::group('index', function () { + Route::rule('malu','Index/malu','get'); # 扫码界面 + Route::rule('malusave','Index/malusave','post'); # 扫码保存 + Route::rule('read','Index/read','post'); # 成绩读取 + Route::rule('biaolu','Index/biaolu','get'); # 保存信息 + Route::rule('saveall','Index/saveAll','post'); # 读取信息 + Route::rule('edit/','Index/edit','get'); # 修改信息 + Route::rule('update/','Index/update','put'); # 更新信息 + Route::rule('list/','Index/index','get'); # 成绩列表 + Route::rule('data','Index/ajaxData','post'); # 成绩获取 + Route::rule('readcjadd/','Index/readAdd','get'); # 成绩录入列表 + Route::rule('dataadd','Index/ajaxaddinfo','post'); # 成绩录入列表数据 + }); + + +// 成绩统计 +Route::group('tongji', function () { + Route::rule('yilucnt/','Tongji/yiluCnt'); # 更新信息 + }); + + +// 班级统计 +Route::group('bjtj', function () { + Route::rule('biaoge','Bjtongji/biaoge','get'); # 班级表格 + Route::rule('data','Bjtongji/ajaxData','post'); # 扫码界面 + Route::rule('dwbiaoge','Bjtongji/dwBiaoge','post'); # 扫码保存 + Route::rule('read','Index/read','post'); # 成绩读取 + Route::rule('biaolu','Index/biaolu','get'); # 保存信息 + Route::rule('saveall','Index/saveAll','post'); # 读取信息 + Route::rule('edit/','Index/edit','get'); # 修改信息 + }); + + //系统设置路由 // Route::resource('/','index/index'); -Route::get('/','index/index'); +// Route::get('/','index/index'); // // 扫码录入成绩 diff --git a/app/chengji/view/index/biaolu.html b/app/chengji/view/index/biaolu.html index 498751bc..d61f3a47 100644 --- a/app/chengji/view/index/biaolu.html +++ b/app/chengji/view/index/biaolu.html @@ -1,4 +1,4 @@ -{extend name="common@create" /} +{extend name=".././view/create.html" /} {block name="form"}
diff --git a/app/chengji/view/index/deletecjs.html b/app/chengji/view/index/deletecjs.html index 1f5a4dbf..bef90245 100644 --- a/app/chengji/view/index/deletecjs.html +++ b/app/chengji/view/index/deletecjs.html @@ -1,4 +1,4 @@ -{extend name="common@create" /} +{extend name=".././view/create.html" /} {block name="form"}
diff --git a/app/chengji/view/index/dw_chengji.html b/app/chengji/view/index/dw_chengji.html index 0baeeb79..031597f2 100644 --- a/app/chengji/view/index/dw_chengji.html +++ b/app/chengji/view/index/dw_chengji.html @@ -1,4 +1,4 @@ -{extend name="common@create" /} +{extend name=".././view/create.html" /} {block name="form"} diff --git a/app/chengji/view/index/edit.html b/app/chengji/view/index/edit.html index 50015273..19fecdb9 100644 --- a/app/chengji/view/index/edit.html +++ b/app/chengji/view/index/edit.html @@ -1,4 +1,4 @@ -{extend name="common@create" /} +{extend name=".././view/create.html" /} {block name="formaa"}
diff --git a/app/chengji/view/index/index.html b/app/chengji/view/index/index.html index 4a195f6e..8ae6cff1 100644 --- a/app/chengji/view/index/index.html +++ b/app/chengji/view/index/index.html @@ -1,5 +1,5 @@ -{extend name="common@list" /} +{extend name=".././view/list.html" /} {block name="jsset"} {/block} @@ -27,7 +27,8 @@
{php} $schoollist = schlist('校级','校级',['小学','中小学']);{/php} {volist name="schoollist" id="vo"} - + {/volist}
@@ -105,7 +106,7 @@ xk = eval(decodeURIComponent(xk)); for(x in xk) { - options.cols[0].push({field: xk[x].subject_name.lieming, title: xk[x].subject_name.title , minWidth:100,sort: true,edit:'text'}); + options.cols[0].push({field: xk[x].subjectName.lieming, title: xk[x].subjectName.title , minWidth:100,sort: true,edit:'text'}); } options.cols[0].push({field: 'avg', title: '平均分', minWidth:100,sort: true}); options.cols[0].push({field: 'sum', title: '总分', minWidth:100,sort: true}); @@ -115,12 +116,12 @@ options.where = { kaoshi:"{$list.kaoshi}" ,nianji:"{$list.nianji}" + ,school:$("input[name='school']:checked").val() } // 设置每页显示条数 options.limit = 10; options.limits = [10,20,30]; - options.height=390; // 提交搜索条件后重载表格 @@ -148,16 +149,15 @@ var data = obj.data; //获得当前行数据 var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值) var tr = obj.tr; //获得当前行 tr 的DOM对象 - console.log(data); switch(layEvent){ case 'detail':// 查看 - cjgl.add(obj.data.student+' 成绩录入信息','/readcjadd/'+obj.data.id,'','',true); + cjgl.add(obj.data.student+' 成绩录入信息','/chengji/index/readcjadd/'+obj.data.id,'','',true); break; case 'del':// 删除 - cjgl.del(obj,"/kaohao"); + cjgl.del(obj,"/kaoshi/kaohao/delete"); break; case 'edit':// 编辑 - cjgl.add('编辑单位','/kaohao/'+obj.data.id+'/edit','650','500'); + cjgl.add('编辑成绩','/kaohao/'+obj.data.id+'/edit','650','500'); break; }; }); diff --git a/app/chengji/view/index/malu.html b/app/chengji/view/index/malu.html index 194bfb09..c0de1382 100644 --- a/app/chengji/view/index/malu.html +++ b/app/chengji/view/index/malu.html @@ -1,4 +1,4 @@ -{extend name="common@createhref" /} +{extend name=".././view/create.html" /} diff --git a/app/chengji/view/index/read_add.html b/app/chengji/view/index/read_add.html index 98774b30..446cf8ec 100644 --- a/app/chengji/view/index/read_add.html +++ b/app/chengji/view/index/read_add.html @@ -1,5 +1,5 @@ -{extend name="common@list" /} +{extend name=".././view/list.html" /} {block name="jsset"} {/block} @@ -35,25 +35,25 @@ {type:'checkbox', fixed: 'left'}, {title: '学科', minWidth:100,sort:false,templet:function(d){ var str=''; - if(d.subject_name) + if(d.subjectName) { - str = d.subject_name.title; + str = d.subjectName.title; } return str; }}, {field: 'defen', title: '得分 ', minWidth:100,sort:false}, {title: '成绩录入',templet:function(d){ var str=''; - if(d.user_name) + if(d.userName) { - str = d.user_name.ad_school.jiancheng + ' ' + d.user_name.xingming; + str = d.userName.adSchool.jiancheng + ' ' + d.userName.xingming; } return str; }}, {field: 'update_time', title: '录入时间 ', minWidth:100,sort:false}, {field: 'id', title: '操作',toolbar: '#barDemo',minWidth:140} ]]; - options.url = "{:url('ajaxaddinfo')}"; + // options.url = "{:url('ajaxaddinfo')}"; // 设置查询条件 options.where = { kaohao:"{$list.kaohao}" diff --git a/app/chengji/view/njtongji/biaoge.html b/app/chengji/view/njtongji/biaoge.html index bcb5612a..fbc923e3 100644 --- a/app/chengji/view/njtongji/biaoge.html +++ b/app/chengji/view/njtongji/biaoge.html @@ -1,5 +1,5 @@ -{extend name="common@list" /} +{extend name=".././view/list.html" /} {block name="jsset"} {/block} diff --git a/app/chengji/view/njtongji/dw_nianji.html b/app/chengji/view/njtongji/dw_nianji.html index c6dc00ba..4b663ac0 100644 --- a/app/chengji/view/njtongji/dw_nianji.html +++ b/app/chengji/view/njtongji/dw_nianji.html @@ -1,4 +1,4 @@ -{extend name="common@create" /} +{extend name=".././view/create.html" /} {block name="form"} diff --git a/app/chengji/view/tongji/yilu_cnt.html b/app/chengji/view/tongji/yilu_cnt.html index e964d419..f3cab26d 100644 --- a/app/chengji/view/tongji/yilu_cnt.html +++ b/app/chengji/view/tongji/yilu_cnt.html @@ -1,5 +1,5 @@ -{extend name="common@list" /} +{extend name=".././view/list.html" /} {block name="jsset"} {/block} @@ -18,7 +18,8 @@
{php} $schoollist = schlist('校级','校级',['小学','中小学']);{/php} {volist name="schoollist" id="vo"} - + {/volist}
@@ -81,8 +82,6 @@