diff --git a/app/kaohao/controller/Index.php b/app/kaohao/controller/Index.php index 2561ba17..a9b349bf 100755 --- a/app/kaohao/controller/Index.php +++ b/app/kaohao/controller/Index.php @@ -2,7 +2,7 @@ namespace app\kaohao\controller; // 引用控制器基类 -use app\base\controller\ToolBase; +use app\base\controller\AdminBase; // 引用数据模型类 use app\kaoshi\model\Kaoshi as KS; @@ -11,7 +11,7 @@ use app\kaohao\model\Kaohao as KH; use think\Validate; -class Index extends ToolBase +class Index extends AdminBase { // 生成考号 public function createAll($kaoshi_id) diff --git a/app/kaoshi/view/index/create_setp2.html b/app/kaoshi/view/index/create_setp2.html index 09d87c6a..05808d34 100644 --- a/app/kaoshi/view/index/create_setp2.html +++ b/app/kaoshi/view/index/create_setp2.html @@ -136,7 +136,7 @@ }); - //监听提交 + //监听提交 form.on('submit(kssubmit)', function(data){ $.ajax({ url:"{$list.set.url}", diff --git a/app/kaoshi/view/index/create_setp3.html b/app/kaoshi/view/index/create_setp3.html index d4a222c6..d505463a 100644 --- a/app/kaoshi/view/index/create_setp3.html +++ b/app/kaoshi/view/index/create_setp3.html @@ -58,7 +58,7 @@
- 完成 @@ -100,6 +100,33 @@ } ); }); + + + //监听提交 + form.on('submit(kssubmit)', function(data){ + $.ajax({ + url:"{$list.set.url}", + type:"{$list.set.formpost}", + data:data.field, + dataType:'json', + success:function(result){ + if(result.val == 1) + { + // $(location).attr('href', '/kaoshi/kaoshiset/create/' + "{$list['set']['kaoshi_id']}"); + parent.layer.msg(result.msg); + }else{ + layer.msg(result.msg); + } + }, + error:function(xhr,status,error) { + layer.msg('数据处理错误',{ + icon: 2, + time: 2000 //2秒关闭(如果不配置,默认是3秒) + }); + } + }); + return false; + }); }); function nextSet() diff --git a/app/luru/route/luru.php b/app/luru/route/luru.php index aa1a180c..6532cf92 100755 --- a/app/luru/route/luru.php +++ b/app/luru/route/luru.php @@ -25,8 +25,8 @@ Route::group('index', function () { Route::rule('biaoqian', 'Index/biaoqian', 'get'); # 信息列表 Route::rule('biaoqianxls', 'Index/biaoqianXls', 'post'); # 信息列表 Route::rule('online', 'Index/online', 'get'); # 在线录入 - Route::rule('onlineedit', 'index/onlineedit', 'post'); # 在线录入 - Route::rule('onlinedata', 'index/ajaxDataOnline', 'post'); # 在线录入 + Route::rule('onlineedit', 'Index/onlineedit', 'post'); # 在线录入 + Route::rule('onlinedata', 'Index/ajaxDataOnline', 'post'); # 在线录入 Route::rule('yilucnt','Index/yiluCnt','get'); # 更新信息 Route::rule('yilutable','Index/yiluCntTable','post'); # 更新信息 Route::rule('datatj','Index/ajaxDatayltj','post'); # 扫码界面 diff --git a/app/middleware/Auth.php b/app/middleware/Auth.php index a1e8d8bd..28fcdcda 100755 --- a/app/middleware/Auth.php +++ b/app/middleware/Auth.php @@ -95,6 +95,7 @@ class Auth // Luru应用 'luru/index/ajaxdatayltj', # 获取已录成绩统计结果 'luru/index/biaoqianxls', # 获取试卷标签数据 + 'luru/index/ajaxdataonline', # 获取试卷标签数据 ); diff --git a/app/teach/controller/BanZhuRen.php b/app/teach/controller/BanZhuRen.php index 71533c22..761d35b4 100755 --- a/app/teach/controller/BanZhuRen.php +++ b/app/teach/controller/BanZhuRen.php @@ -56,7 +56,7 @@ class BanZhuRen extends AdminBase 'id' ,'glAdmin' => ['xingming'] ,'banji_id' - ,'admin_id' + ,'teacher_id' ,'bfdate' ,'update_time' ]); # 查询数据 @@ -100,7 +100,7 @@ class BanZhuRen extends AdminBase // 获取表单数据 $list = request()->only([ 'banji_id' - ,'admin_id' + ,'teacher_id' ,'bfdate' ], 'post'); @@ -133,7 +133,7 @@ class BanZhuRen extends AdminBase $bzr = new bzr; $bjInfo = $bzr ->where('id', $id) - ->field('id,admin_id, banji_id, bfdate') + ->field('id,teacher_id, banji_id, bfdate') ->with([ 'glAdmin' => function ($query) { $query->field('id, xingming'); @@ -145,7 +145,7 @@ class BanZhuRen extends AdminBase ->find(); $list['data']['school_id'] = $bjInfo->glBanji->school_id; $list['data']['banji_id'] = $bjInfo->banji_id; - $list['data']['admin_id'] = $bjInfo->admin_id; + $list['data']['teacher_id'] = $bjInfo->teacher_id; $list['data']['xingming'] = $bjInfo->glAdmin->xingming; $list['data']['bfdate'] = $bjInfo->bfdate; @@ -170,7 +170,7 @@ class BanZhuRen extends AdminBase // 获取表单数据 $list = request()->only([ 'bfdate' - ,'admin_id' + ,'teacher_id' ], 'put'); $list['id'] = $id; @@ -184,7 +184,7 @@ class BanZhuRen extends AdminBase // 更新数据 $bzrlist = bzr::find($id); - $bzrlist->admin_id = $list['admin_id']; + $bzrlist->teacher_id = $list['teacher_id']; $bzrlist->bfdate = $list['bfdate']; $data = $bzrlist->save(); diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php index 438cdcdf..d6e7522f 100755 --- a/database/seeds/Rule.php +++ b/database/seeds/Rule.php @@ -134,8 +134,8 @@ class Rule extends Seeder ], // 占位 ['id' => 10701 - ,'title' => '占位' - ,'name' => 'zaixian1' + ,'title' => '编辑' + ,'name' => 'luru/index/onlineedit' ,'paixu' => 1 ,'pid' => 107 ], diff --git a/database/seeds/TongjiXingmu.php b/database/seeds/TongjiXingmu.php index b6132537..78dd406d 100755 --- a/database/seeds/TongjiXingmu.php +++ b/database/seeds/TongjiXingmu.php @@ -1221,12 +1221,7 @@ class TongjiXingmu extends Seeder // ] ]; - $serRows = $this->fetchAll('select * from cj_tongji_xiangmu'); - if(is_array($serRows) && count($serRows) > 0) - { - $rows = []; - return true; - } + $this->execute('DELETE FROM cj_tongji_xiangmu where id>0'); // 保存数据 $this->table('tongji_xiangmu')->insert($rows)->save();