From 87531be631736527c985da0dc6c0ef421d962f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Sun, 24 Jan 2021 09:02:01 +0800 Subject: [PATCH] 0 --- app/BaseController.php | 1 + app/chengji/view/index/index.html | 1 + app/kaoshi/controller/Index.php | 12 ++ app/kaoshi/model/Kaoshi.php | 8 ++ app/kaoshi/route/kaoshi.php | 7 +- app/kaoshi/view/index/index.html | 12 +- app/kaoshi/view/index/more_action.html | 72 ++++------- app/login/view/index/shangma_log.html | 7 +- app/teacherSearchChengji/controller/Index.php | 10 ++ .../controller/Kaoshi.php | 114 ++++++++++++++++-- app/teacherSearchChengji/route/teacher.php | 34 ++++++ database/seeds/Rule.php | 14 +-- 12 files changed, 215 insertions(+), 77 deletions(-) diff --git a/app/BaseController.php b/app/BaseController.php index bf62275a..64cd5303 100755 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -40,6 +40,7 @@ abstract class BaseController 'online' ]; + /** * 构造方法 * @access public diff --git a/app/chengji/view/index/index.html b/app/chengji/view/index/index.html index 1ed70904..7bef9a2d 100755 --- a/app/chengji/view/index/index.html +++ b/app/chengji/view/index/index.html @@ -83,6 +83,7 @@ // 设置列 options.cols=[[ //表头 {type:'checkbox', fixed: 'left'}, + {type:'numbers', fixed: 'left', title: '序号'}, {field: 'school_jiancheng', title: '学校', minWidth:100,sort: true}, // {field: 'nianji', title: '年级 ', minWidth:100,sort: true}, {field: "ban_title",title: '班级', minWidth:120,sort: true}, diff --git a/app/kaoshi/controller/Index.php b/app/kaoshi/controller/Index.php index 3c916e17..c126edbb 100755 --- a/app/kaoshi/controller/Index.php +++ b/app/kaoshi/controller/Index.php @@ -21,6 +21,18 @@ class Index extends AdminBase $list['status'] = '/kaoshi/index/status'; $list['luru'] = '/kaoshi/index/luru'; + // 设置要给模板赋值的信息 + $list['webtitle'] = '考试列表'; + $list['dataurl'] = '/kaoshi/index/data'; + $list['status'] = '/kaoshi/index/status'; + $list['luru'] = '/kaoshi/index/luru'; + $list['create'] = '/kaoshi/index/create'; + $list['edit'] = '/kaoshi/index/edit'; + $list['delete'] = '/kaoshi/index/delete'; + $list['more'] = '/kaoshi/index/more'; + $list['user_group'] = 'admin'; + $list['user_id'] = session('user_id'); + // 模板赋值 $this->view->assign('list', $list); // 渲染模板 diff --git a/app/kaoshi/model/Kaoshi.php b/app/kaoshi/model/Kaoshi.php index c8b46dee..7ee196c2 100755 --- a/app/kaoshi/model/Kaoshi.php +++ b/app/kaoshi/model/Kaoshi.php @@ -18,6 +18,8 @@ class Kaoshi extends BaseModel ,'xueqi_id' => '' ,'category_id' => array() ,'searchval' => '' + ,'user_group' => 'everyone' + ,'user_id' => '' ]; // 用新值替换初始值 $src = array_cover($srcfrom, $src); @@ -31,6 +33,12 @@ class Kaoshi extends BaseModel ->when(strlen($src['searchval']) > 0, function($query) use($src){ $query->where('title', 'like', '%' . $src['searchval']. ' %'); }) + ->when(strlen($src['user_group']) > 0, function($query) use($src){ + $query->where('user_group', $src['user_group']) + ->when($src['user_group'] == 'teacher', function($q) use($src){ + $q->where('user_id', $src['user_id']); + }); + }) ->when(count($src['zuzhi_id']) > 0, function($query) use($src){ $query->where('zuzhi_id', 'in', $src['zuzhi_id']); }) diff --git a/app/kaoshi/route/kaoshi.php b/app/kaoshi/route/kaoshi.php index 0a245313..36198ad2 100755 --- a/app/kaoshi/route/kaoshi.php +++ b/app/kaoshi/route/kaoshi.php @@ -22,12 +22,7 @@ Route::group('index', function () { Route::rule('delete/','Index/delete','delete'); # 删除信息 Route::rule('status','Index/setStatus','post'); # 删除信息 Route::rule('more/','Index/moreAction','get'); # 修改信息 - Route::rule('cyschool','Index/cySchool','post'); # 获取参加考试班级 - Route::rule('cynianji','Index/cyNianji','post'); # 获取参加考试班级 - Route::rule('cybanji','Index/cyBanji','post'); # 获取参加考试班级 - Route::rule('cysubject','Index/cySubject','post'); # 获取参加考试学科 - Route::rule('kaoshiinfo/','Index/kaoshiInfo','post'); # 获取参加考试的学校、学科、班级、年级等信息 - Route::rule('luru','Index/luru','post'); # 删除信息 + Route::rule('luru','Index/luru','post'); # 考试编辑状态 }); diff --git a/app/kaoshi/view/index/index.html b/app/kaoshi/view/index/index.html index 018d9d3a..c8df3edb 100755 --- a/app/kaoshi/view/index/index.html +++ b/app/kaoshi/view/index/index.html @@ -38,6 +38,8 @@ {/volist} + + {/block} {block name="table"} @@ -107,10 +109,10 @@ switch(obj.event){ case 'dels': var checkStatus = table.checkStatus('mytable'); //idmytable 即为基础参数 id 对应的值 - cjgl.delAll(checkStatus, 'index/delete', 'mytable'); + cjgl.delAll(checkStatus, "{$list.delete}", 'mytable'); break; case 'add': - cjgl.add('新建考试', 'index/create', '600', '400', false); + cjgl.add('新建考试', "{$list.create}", '600', '400', false); break; }; }); @@ -122,13 +124,13 @@ var tr = obj.tr; //获得当前行 tr 的DOM对象 switch(layEvent){ case 'del':// 删除 - cjgl.del(obj, "index/delete"); + cjgl.del(obj, "{$list.delete}"); break; case 'edit':// 编辑 - cjgl.add('编辑考试', 'index/edit/' + obj.data.id, '600', '400', false); + cjgl.add('编辑考试', "{$list.edit}/" + obj.data.id, '600', '400', false); break; case 'more':// 状态 - cjgl.addTab(obj.data.title + ' 操作', '/kaoshi/index/more/' + obj.data.id, true); + cjgl.addTab(obj.data.title + ' 操作', "{$list.more}/" + obj.data.id, true); break; }; }); diff --git a/app/kaoshi/view/index/more_action.html b/app/kaoshi/view/index/more_action.html index 1be8c294..2b24c3ec 100755 --- a/app/kaoshi/view/index/more_action.html +++ b/app/kaoshi/view/index/more_action.html @@ -34,62 +34,40 @@ - {php}$kaoshi_id =$list['kaoshi_id']; {/php} + {php} $kaoshi_id = $list['kaoshi_id'];{/php}
    -
  • 一、前期操作
  • -
  • 二、表格录入
  • -
  • 三、成绩统计
  • -
  • 四、统计结果
  • + {volist name="list.menu" id="vo"} +
  • {$vo.title}
  • + {/volist}
- -
+ {volist name="list.menu" id="vo"} + + {/volist}
diff --git a/app/login/view/index/shangma_log.html b/app/login/view/index/shangma_log.html index babcbb7b..898c8cca 100755 --- a/app/login/view/index/shangma_log.html +++ b/app/login/view/index/shangma_log.html @@ -47,13 +47,16 @@
  • -

    V1.3.8 2021-1-7

    +

    V1.3.8 2021-1-17

    修改超过算法
    - 修复书籍错误
    + 修复已知错误:表格上传教师错误、phinx、登录页面……
    + 优化:雷达图学科显示、成绩位置算法…… 增加学生帐号显示成绩或等级设置
    增加统计项目
    将统计项目作用扩展到下载和教师帐号
    + 增加清除演示数据
    + 添加数据库升级与降级

  • diff --git a/app/teacherSearchChengji/controller/Index.php b/app/teacherSearchChengji/controller/Index.php index 66c39f27..4caa7a51 100755 --- a/app/teacherSearchChengji/controller/Index.php +++ b/app/teacherSearchChengji/controller/Index.php @@ -63,6 +63,16 @@ class Index extends TeacherSearchBase ] ] ] + ,[ + 'title' => '考试管理' + ,'font' => '' + ,'authCid' => [ + [ + 'title' => '考试列表' + ,'url' => '/teacherSearchChengji/kaoshi' + ] + ] + ] ]; if($sysClass->teacherrongyu) diff --git a/app/teacherSearchChengji/controller/Kaoshi.php b/app/teacherSearchChengji/controller/Kaoshi.php index a6438774..4aaf6c45 100644 --- a/app/teacherSearchChengji/controller/Kaoshi.php +++ b/app/teacherSearchChengji/controller/Kaoshi.php @@ -6,22 +6,32 @@ namespace app\TeacherSearchChengji\controller; // 引用学生查询基类 use \app\base\controller\TeacherSearchBase; +// 引用考试数据模型类 +use app\kaoshi\model\Kaoshi as KS; +use app\middleware\KaoshiStatus; + class Kaoshi extends TeacherSearchBase { // 显示考试列表 public function index() { // 设置要给模板赋值的信息 + $url = '/TeacherSearchChengji/kaoshi/'; $list['webtitle'] = '考试列表'; - $list['dataurl'] = '/kaoshi/index/data'; - $list['status'] = '/kaoshi/index/status'; - $list['luru'] = '/kaoshi/index/luru'; - $list['create'] = '/kaoshi/index/create'; + $list['dataurl'] = $url . 'data'; + $list['status'] = $url . 'status'; + $list['luru'] = $url . 'luru'; + $list['create'] = $url . 'create'; + $list['edit'] = $url . 'edit'; + $list['delete'] = $url . 'delete'; + $list['more'] = $url . 'more'; + $list['user_group'] = 'teacher'; + $list['user_id'] = session('user_id'); // 模板赋值 $this->view->assign('list', $list); // 渲染模板 - return $this->view->fetch('kaoshi@index/create'); + return $this->view->fetch('kaoshi@index/index'); } @@ -38,7 +48,8 @@ class Kaoshi extends TeacherSearchBase ,'field' => 'id' ,'order' => 'desc' ,'searchval' => '' - ,'user_group' => 'admin' + ,'user_group' => '' + ,'user_id' => '' ], 'POST'); // 根据条件查询数据 $ks = new KS; @@ -69,13 +80,13 @@ class Kaoshi extends TeacherSearchBase 'webtitle' => '新建考试' ,'butname' => '创建' ,'formpost' => 'POST' - ,'url' => '/kaoshi/index/save' + ,'url' => '/TeacherSearchChengji/kaoshi/save' ); // 模板赋值 $this->view->assign('list', $list); // 渲染 - return $this->view->fetch('kaoshi@inex/create'); + return $this->view->fetch('kaoshi@index/create'); } @@ -127,7 +138,7 @@ class Kaoshi extends TeacherSearchBase 'webtitle' => '编辑考试' ,'butname' => '修改' ,'formpost' => 'PUT' - ,'url' => '/kaoshi/index/update/' . $id + ,'url' => '/TeacherSearchChengji/kaoshi/update/' . $id ); // 模板赋值 @@ -234,8 +245,91 @@ class Kaoshi extends TeacherSearchBase // 设置页面标题 $list['webtitle'] = $kaoshi->title . '(' . $kaoshi->bfdate . '~' . $kaoshi->enddate . ')'; $list['kaoshi_id'] = $kaoshi->id; + + // 设置操作 + $url = '/TeacherSearchChengji/'; + $list['menu'] = [ + [ + 'title' => '一、前期操作' + ,'top' =>[ + [ + 'title' => '考试设置' + ,'oncleck' => 'addteb' + ,'url' => $url . 'kaoshiset/index/' . $list['kaoshi_id'] + ,'font' => '' + ,'w' => 600 + ,'h' => 300 + ] + ,[ + 'title' => '生成考号' + ,'oncleck' => 'addlayer' + ,'url' => $url . 'kaohao/createall/' . $list['kaoshi_id'] + ,'font' => '' + ,'w' => 600 + ,'h' => 300 + ] + ,[ + 'title' => '下载试卷标签数据' + ,'oncleck' => 'addlayer' + ,'url' => $url . 'excel/biaoqian/' . $list['kaoshi_id'] + ,'font' => '' + ,'w' => 600 + ,'h' => 300 + ] + + ] + ] + ,[ + 'title' => '二、表格录入' + ,'top' =>[ + [ + 'title' => '下载成绩录入表格' + ,'oncleck' => 'addlayer' + ,'url' => $url . 'excel/caiji/' . $list['kaoshi_id'] + ,'font' => '' + ,'w' => 600 + ,'h' => 300 + ] + ,[ + 'title' => '已录成绩数量' + ,'oncleck' => 'addteb' + ,'url' => $url . '/chengji/tongji/yilucnt/' . $list['kaoshi_id'] + ,'font' => '' + ,'w' => 600 + ,'h' => 300 + ] + + ] + ] + ,[ + 'title' => '三、成绩统计' + ,'top' =>[ + [ + 'title' => '考试设置' + ,'oncleck' => 'addteb' + ,'url' => $url . 'kaoshiset/index/' . $list['kaoshi_id'] + ,'font' => '' + ] + + ] + ] + ,[ + 'title' => '四、统计结果' + ,'top' =>[ + [ + 'title' => '考试设置' + ,'oncleck' => 'addteb' + ,'url' => $url . 'kaoshiset/index/' . $list['kaoshi_id'] + ,'font' => '' + ] + + ] + ] + ]; + + $this->view->assign('list', $list); // 渲染 - return $this->view->fetch(); + return $this->view->fetch('kaoshi@index/more_action'); } } diff --git a/app/teacherSearchChengji/route/teacher.php b/app/teacherSearchChengji/route/teacher.php index 4504f0c1..2babc53b 100755 --- a/app/teacherSearchChengji/route/teacher.php +++ b/app/teacherSearchChengji/route/teacher.php @@ -26,3 +26,37 @@ Route::group('index', function () { Route::rule('rongyu','Index/rongyu','get'); # 信息列表 Route::rule('keti','Index/keti','get'); # 信息列表 }); + +// 考试管理 +Route::group('kaoshi', function () { + Route::rule('','Kaoshi/index','get'); # 信息列表 + Route::rule('data','Kaoshi/ajaxData','post'); # 获取数据 + Route::rule('create','Kaoshi/create','get'); # 添加信息 + Route::rule('save','Kaoshi/save','post'); # 保存信息 + Route::rule('edit/','Kaoshi/edit','get'); # 修改信息 + Route::rule('update/','Kaoshi/update','put'); # 更新信息 + Route::rule('delete/','Kaoshi/delete','delete'); # 删除信息 + Route::rule('status','Kaoshi/setStatus','post'); # 删除信息 + Route::rule('more/','Kaoshi/moreAction','get'); # 修改信息 + Route::rule('luru','Kaoshi/luru','post'); # 考试编辑状态设置 +}); + + +// 考试设置 +Route::group('kaoshiset', function () { + Route::rule('index/','KaoshiSet/index','get'); # 信息列表 + Route::rule('data','KaoshiSet/ajaxdata','post'); # 获取数据 + Route::rule('create/','KaoshiSet/create','get'); # 添加信息 + Route::rule('save','KaoshiSet/save','post'); # 保存信息 + Route::rule('edit/','KaoshiSet/edit','get'); # 修改信息 + Route::rule('update/','KaoshiSet/update','put'); # 更新信息 + Route::rule('delete/','KaoshiSet/delete','delete'); # 删除信息 + Route::rule('status','KaoshiSet/setStatus','post'); # 修改状态 +}); + + +// 考试设置 +Route::group('tjlog', function () { + Route::rule('index/','TongjiLog/index','get'); + Route::rule('data','TongjiLog/ajaxData','post'); +}); diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php index 754f5054..7a510a1f 100755 --- a/database/seeds/Rule.php +++ b/database/seeds/Rule.php @@ -1232,7 +1232,7 @@ class Rule extends Seeder ,'paixu' => 1 ,'pid' => 705 ], - // // 下次要添加上 + // 下次要添加上 // ['id' => 70502 // ,'title' => '初始化' // ,'name' => 'system/systembase/resetmayi' @@ -1764,12 +1764,12 @@ class Rule extends Seeder ]; - $serRows = $this->fetchAll('select * from cj_auth_rule'); - if(is_array($serRows) && count($serRows) > 0) - { - $rows = []; - return true; - } + // $serRows = $this->fetchAll('select * from cj_auth_rule'); + // if(is_array($serRows) && count($serRows) > 0) + // { + // $rows = []; + // return true; + // } // 保存数据 $this->table('auth_rule')->insert($rows)->save(); }