From 7f057f54eef0a26a0dffcdb3e2f126b1661d4a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Mon, 22 Mar 2021 16:45:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=BE=97=E4=B9=B1=E4=B8=83=E5=85=AB?= =?UTF-8?q?=E7=B3=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/controller/Bjtongji.php | 19 ++++++++ app/chengji/model/TongjiBj.php | 47 +++++++++++++++++++ app/chengji/route/chengji.php | 1 + app/chengji/view/bjtongji/renke.html | 2 - .../view/bjtongji/renke_edit_teacher.html | 4 +- app/kaoshi/view/index/index.html | 3 -- app/kaoshi/view/kaoshi_set/index.html | 2 +- app/middleware/Auth.php | 8 +++- app/teach/route/teach.php | 4 +- database/seeds/Teacher.php | 42 ----------------- public/static/x-admin2.2/js/canyuKaoshi.js | 31 ++++++++++++ public/static/x-admin2.2/js/createInput.js | 5 ++ 12 files changed, 115 insertions(+), 53 deletions(-) delete mode 100644 database/seeds/Teacher.php diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index 97ab5011..2375ffde 100755 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -641,4 +641,23 @@ class Bjtongji extends AdminBase } + // 查询已经有统计结果的学科 + public function srcSubject() + { + // 获取参数 + $src = $this->request + ->only([ + 'kaoshi_id' => '' + ,'school_id' => '' + ,'ruxuenian' => '' + ,'limit' => 100 + ], 'POST'); + $btj = new BTJ(); + // 获取参考年级 + $data = $btj->srcSubject($src); + $data = reSetArray($data, $src); + return json($data); + } + + } diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index f7ffab3d..c8b6a4bd 100755 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -742,4 +742,51 @@ class TongjiBj extends BaseModel return $chalv; } + + + // 查询学科 + function srcSubject($srcfrom) + { + // 初始化参数 + $src = array( + 'kaoshi_id' => '' + ,'school_id' => '' + ,'ruxuenian' => '' + ); + $src = array_cover($srcfrom, $src); + + $list = $this->where('kaoshi_id', $src['kaoshi_id']) + ->where('banji_id', 'in', function($query) use($src) { + $query + ->name('banji') + ->when(strlen($src['school_id']) > 0, function($q) use ($src) { + $q->where('school_id', $src['school_id']); + }) + ->when(strlen($src['ruxuenian']) > 0, function($q) use ($src) { + $q->where('ruxuenian', $src['ruxuenian']); + }) + ->field('id'); + }) + ->where('subject_id', '<>', 0) + ->with([ + 'bjSubject' => function ($query) { + $query->field('id, title, jiancheng'); + } + ]) + ->field('subject_id') + ->distinct(true) + ->select(); + + $data = array(); + + foreach ($list as $key => $value) { + $data[] = [ + 'id' => $value->subject_id + ,'title' => $value->bjSubject->title + ,'jiancheng' => $value->bjSubject->jiancheng + ]; + } + + return $data; + } } diff --git a/app/chengji/route/chengji.php b/app/chengji/route/chengji.php index 039a7fc0..d57ab380 100755 --- a/app/chengji/route/chengji.php +++ b/app/chengji/route/chengji.php @@ -54,6 +54,7 @@ Route::group('bjtj', function () { Route::rule('renkeupdate/','Bjtongji/renkeUpdate','put'); # 班级表格 Route::rule('renkeeditteacher/','Bjtongji/renkeEditTeacher','get'); # 设置任课教师 Route::rule('renkeupdateteaher','Bjtongji/renkeUpdateTeacher','put'); # 更新任课教师 + Route::rule('subject','Bjtongji/srcSubject','post'); # 成绩获取 }); diff --git a/app/chengji/view/bjtongji/renke.html b/app/chengji/view/bjtongji/renke.html index 0c7ce794..5b4a2376 100755 --- a/app/chengji/view/bjtongji/renke.html +++ b/app/chengji/view/bjtongji/renke.html @@ -1,7 +1,5 @@ {extend name=".././view/list.html" /} {block name="jsset"} -{load href="__STATIC__/echarts/echarts.js" /} -{load href="__STATIC__/echarts/infographic.js" /} {/block} {block name="nav"} diff --git a/app/chengji/view/bjtongji/renke_edit_teacher.html b/app/chengji/view/bjtongji/renke_edit_teacher.html index 06ea9c7f..1ad9a92b 100755 --- a/app/chengji/view/bjtongji/renke_edit_teacher.html +++ b/app/chengji/view/bjtongji/renke_edit_teacher.html @@ -52,7 +52,7 @@ layui.use(['createInput', 'canyuKaoshi', 'form'], function() { form = layui.form; // 搜索教师 - xmselect = cInput.searchTeacher('teacher_id', true); + xmselect = cInput.searchTeacher('teacher_id',form.val('myform').school_id, true); canyu.schoolSelect('school_id', "{$list.data.kaoshi_id}"); canyu.gradeSelect('ruxuenian', "{$list.data.kaoshi_id}"); @@ -62,7 +62,7 @@ layui.use(['createInput', 'canyuKaoshi', 'form'], function() { if (data.school_id > 0 && data.ruxuenian > 0) { canyu.banjiCheckbox('banji_id', data); } - canyu.subjectSelect('subject_id', data); + canyu.btjSubjectSelect('subject_id', data); }); diff --git a/app/kaoshi/view/index/index.html b/app/kaoshi/view/index/index.html index 91b11bcd..95c182c0 100755 --- a/app/kaoshi/view/index/index.html +++ b/app/kaoshi/view/index/index.html @@ -153,9 +153,6 @@ layui.use(['table', 'mytable','createInput','form'], function() { case 'edit': // 编辑 xadmin.open('编辑考试', '/kaoshi/index/edit/' + obj.data.id, '600', '400', false); break; - case 'more': // 状态 - parent.xadmin.add_tab(obj.data.title + ' 操作', '/kaoshi/index/more/' + obj.data.id, true); - break; case 'tongji': // 状态 xadmin.open(obj.data.title + ' 成绩统计', '/kaoshi/index/tongji/' + obj.data.id, '650', '400', false); break; diff --git a/app/kaoshi/view/kaoshi_set/index.html b/app/kaoshi/view/kaoshi_set/index.html index 963b6ba3..5db8943d 100755 --- a/app/kaoshi/view/kaoshi_set/index.html +++ b/app/kaoshi/view/kaoshi_set/index.html @@ -107,7 +107,7 @@ mytable.delAll(checkStatus,'/kaoshi/kaoshiset/delete','mytable'); break; case 'add': - parent.xadmin.add_tab('添加参考学科','/kaoshi/kaoshiset/create/'+"{$list.kaoshi_id}",'650','400', false); + xadmin.open('添加参考学科','/kaoshi/kaoshiset/create/'+"{$list.kaoshi_id}",'650','400', true); break; }; }); diff --git a/app/middleware/Auth.php b/app/middleware/Auth.php index a855d3da..c81a8351 100755 --- a/app/middleware/Auth.php +++ b/app/middleware/Auth.php @@ -69,6 +69,8 @@ class Auth 'teach/banji/mybanji', # 获取班级数据 'teach/banji/banjilist', # 获取班级数据 'teach/banjichengji/ajaxdatatiaoxing', # 获取班级成绩-条形统计表 + 'teach/xueqi/srcxueqi', # 获取班级成绩-条形统计表 + 'teach/banji/njlist', # 获取班级数据 // Kaoshi应用 'kaoshi/index/srceditkaoshi', # 获取可以编辑的考试列表 'kaoshi/kscanyu/school', # 获取参加考试学校 @@ -87,7 +89,7 @@ class Auth 'student/studentchengji/ajaxonestudentchengjitubiao', # 获取学生成绩拆线图数据 'student/studentchengji/ajaxonestudentchengjileida', # 获取学生成绩雷达图数据 'student/studentchengji/ajaxonestudentchengjiyibiao', # 获取学生成绩雷达图数据 - 'teacher/index/ajaxdatadel', # 获取删除教师列表 + // 'teacher/index/ajaxdatadel', # 获取删除教师列表 // Chengji应用 'chengji/index/ajaxaddinfo', # 获取录入该学生成绩人员的信息 'chengji/index/dwchengjixlsx', # 下载学生成绩 @@ -97,6 +99,7 @@ class Auth 'chengji/bjtongji/myxiangti', # 获取成绩箱体图数据 'chengji/bjtongji/myfenshuduan', # 获取成绩各分数段折线统计图数据 'chengji/bjtongji/ajaxdatarenke', # 获取成绩各分数段折线统计图数据 + 'chengji/bjtongji/srcsubject', # 获取成绩各分数段折线统计图数据 'chengji/njtongji/dwnianjixlsx', # 下载年级成绩统计表 'chengji/njtongji/myavg', # 获取单项成绩数据 'chengji/njtongji/myxiangti', # 获取成绩箱体图数据 @@ -104,6 +107,9 @@ class Auth 'luru/index/ajaxdatayltj', # 获取已录成绩统计结果 'luru/index/biaoqianxls', # 获取试卷标签数据 'luru/index/ajaxdataonline', # 获取试卷标签数据 + // 系统设置 + 'system/school/srcschool', # 获学校 + 'system/category/srcchildren', # 获学校 ); diff --git a/app/teach/route/teach.php b/app/teach/route/teach.php index b6290894..8fb4455b 100755 --- a/app/teach/route/teach.php +++ b/app/teach/route/teach.php @@ -36,8 +36,8 @@ Route::group('banji', function () { Route::rule('yidong/','banji/yidong','post'); # 删除信息 Route::rule('mybanji','banji/mybanji','post'); # 删除信息 Route::rule('mybanjis','banji/banjiList','post'); # 删除信息 - Route::rule('alias','banji/setAlias','put'); # 删除信息 - Route::rule('njlist','banji/njList','post'); # 获取年级列表 + Route::rule('alias','banji/setAlias','put'); # 删除信息 + Route::rule('njlist','banji/njList','post'); # 获取年级列表 }); diff --git a/database/seeds/Teacher.php b/database/seeds/Teacher.php deleted file mode 100644 index 79eb5aa3..00000000 --- a/database/seeds/Teacher.php +++ /dev/null @@ -1,42 +0,0 @@ - '嬴政' - ,'sex' => 1 - ,'shengri' => 533491200 - ,'worktime' => 1188144000 - ,'danwei_id' =>2 - ,'quanpin' => 'yingzheng' - ,'shoupin' => 'yz' - ,'phone' => 13190180000 - ,'password' => '$apr1$RSUodBwI$zOhVq9RQWfQDOW2sbeCDS1' - ] - ]; - - $serRows = $this->fetchAll('select * from cj_teacher'); - if(is_array($serRows) && count($serRows) > 0) - { - $rows = []; - return true; - } - - // 保存数据 - $this->table('teacher')->insert($rows)->save(); - } -} \ No newline at end of file diff --git a/public/static/x-admin2.2/js/canyuKaoshi.js b/public/static/x-admin2.2/js/canyuKaoshi.js index 7e1f9d02..8ae9161a 100644 --- a/public/static/x-admin2.2/js/canyuKaoshi.js +++ b/public/static/x-admin2.2/js/canyuKaoshi.js @@ -284,6 +284,37 @@ layui.define(['table', 'form', 'upload'], function(exports) { }, + // 班级统计结果学科 + btjSubjectSelect: function(myid, data, value = '', hasNull = true) { + $('#' + myid).children().remove(); + $.ajax({ + url: '/chengji/bjtj/subject', + type: 'POST', + data: data, + success: function(result) { + if (hasNull == true) { + str = ''; + } else { + str = ''; + } + temp = ""; + $(result.data).each(function(i, el) { + if (value != '' && value == el.id) { + temp = ''; + } else { + temp = ''; + } + str = str + temp; + }); + $('#' + myid).append(str); + form.render('select'); + }, + error: function(result) { + layer.msg('数据扔半道啦。', function() {}); + }, + }); + }, + }; //输出test接口 exports('canyuKaoshi', obj); diff --git a/public/static/x-admin2.2/js/createInput.js b/public/static/x-admin2.2/js/createInput.js index 4d8b02a5..07af6845 100644 --- a/public/static/x-admin2.2/js/createInput.js +++ b/public/static/x-admin2.2/js/createInput.js @@ -173,6 +173,11 @@ layui.extend({ name = id; } var school_id = ''; + var mydiv = $('#' + id); + + school_id = mydiv.eq(0); + console.log(school_id); + x = xmSelect.render({ el: '#' + id, name: name,