diff --git a/app/admin/view/index/create.html b/app/admin/view/index/create.html
index a7d54e02..883f6f7c 100755
--- a/app/admin/view/index/create.html
+++ b/app/admin/view/index/create.html
@@ -49,7 +49,7 @@
-
+
diff --git a/app/kaohao/controller/Index.php b/app/kaohao/controller/Index.php
index a9b349bf..41b59b73 100755
--- a/app/kaohao/controller/Index.php
+++ b/app/kaohao/controller/Index.php
@@ -77,7 +77,7 @@ class Index extends AdminBase
// 获取参加考试年级数组
$enddate = KS::where('id', $list['kaoshi_id'])->value('enddate');
- $njlist = nianJiNameList('str', $enddate);
+ $njlist = \app\facade\Tools::nianJiNameList($enddate, 'str');
// 重新组合学生信息
$kaohao = array();
foreach ($stulist as $key => $value) {
diff --git a/app/kaohao/view/index/create.html b/app/kaohao/view/index/create.html
index a3aec963..5b62befd 100755
--- a/app/kaohao/view/index/create.html
+++ b/app/kaohao/view/index/create.html
@@ -69,9 +69,9 @@
{block name="myjs"}
diff --git a/app/kaoshi/controller/KaoshiSet.php b/app/kaoshi/controller/KaoshiSet.php
index 859cd61e..1f269d75 100755
--- a/app/kaoshi/controller/KaoshiSet.php
+++ b/app/kaoshi/controller/KaoshiSet.php
@@ -113,7 +113,11 @@ class KaoshiSet extends AdminBase
,'subject_id' => array()
,'manfen' => array()
,'youxiu' => array()
+ ,'lianghao' => array()
,'jige' => array()
+ ,'youxiubi' => array()
+ ,'lianghaobi' => array()
+ ,'jigebi' => array()
], 'POST');
event('kslu', $src['kaoshi_id']);
@@ -137,7 +141,11 @@ class KaoshiSet extends AdminBase
'subject_id' => $value,
'manfen' => $src['manfen'][$key],
'youxiu' => $src['youxiu'][$key],
+ 'lianghao' => $src['lianghao'][$key],
'jige' => $src['jige'][$key],
+ 'youxiubi' => $src['youxiubi'][$key],
+ 'lianghaobi' => $src['lianghaobi'][$key],
+ 'jigebi' => $src['jigebi'][$key],
];
}
@@ -175,7 +183,7 @@ class KaoshiSet extends AdminBase
// 获取考试信息
$ksset = new ksset;
$list['data'] = $ksset::where('id',$id)
- ->field('id, kaoshi_id, nianjiname, subject_id, manfen, youxiu, jige')
+ ->field('id, kaoshi_id, nianjiname, subject_id, manfen, youxiu, lianghao, jige, youxiubi, lianghaobi, jigebi')
->with([
'subjectName' => function($query){
$query->field('id, title, jiancheng');
@@ -213,7 +221,11 @@ class KaoshiSet extends AdminBase
,'kaoshi_id'
,'manfen'
,'youxiu'
+ ,'lianghao'
,'jige'
+ ,'youxiubi'
+ ,'lianghaobi'
+ ,'jigebi'
], 'POST');
// 验证表单数据
diff --git a/app/kaoshi/controller/LuruFengong.php b/app/kaoshi/controller/LuruFengong.php
index 93739771..ddc3590a 100644
--- a/app/kaoshi/controller/LuruFengong.php
+++ b/app/kaoshi/controller/LuruFengong.php
@@ -87,8 +87,7 @@ class LuruFengong extends AdminBase
// 获取考试时间
$ks = new \app\kaoshi\model\Kaoshi;
$enddate = $ks->kaoshiInfo($kaoshi_id);
- $enddate = $enddate->getData('enddate');
- $list['set']['nianji'] = nianJiNameList('str', $enddate);
+ $list['set']['enddate'] = $enddate->getData('enddate');
// 模板赋值
$this->view->assign('list', $list);
diff --git a/app/kaoshi/model/LuruFengong.php b/app/kaoshi/model/LuruFengong.php
index 8755ba5f..fd07a552 100644
--- a/app/kaoshi/model/LuruFengong.php
+++ b/app/kaoshi/model/LuruFengong.php
@@ -23,6 +23,7 @@ class LuruFengong extends BaseModel
$src = array_cover($srcfrom, $src) ;
$src['kaoshi_id'] = strToarray($src['kaoshi_id']);
$src['banji_id'] = strToarray($src['banji_id']);
+ $src['subject_id'] = strToarray($src['subject_id']);
$logList = self::where('kaoshi_id', 'in', $src['kaoshi_id'])
->when(count($src['banji_id']) > 0, function($query) use($src){
diff --git a/app/kaoshi/validate/KaoshiSetEdit.php b/app/kaoshi/validate/KaoshiSetEdit.php
index 46950619..cf63d351 100755
--- a/app/kaoshi/validate/KaoshiSetEdit.php
+++ b/app/kaoshi/validate/KaoshiSetEdit.php
@@ -17,8 +17,12 @@ class KaoshiSetEdit extends Validate
'id|ID' => 'require|integer',
'kaoshi_id|考试ID' => 'require|integer',
'manfen|满分' => 'require|number',
- 'youxiu|优秀' => 'require|number',
- 'jige|及格' => 'require|number',
+ 'youxiu|优秀分数线' => 'require|number',
+ 'lianghao|良好分数线' => 'require|number',
+ 'jige|及格分数线' => 'require|number',
+ 'youxiu|优秀人数比' => 'require|number',
+ 'lianghao|良好人数比' => 'require|number',
+ 'jige|及格人数比' => 'require|number',
// 'lieming|列名' => 'require|array',
];
@@ -31,6 +35,6 @@ class KaoshiSetEdit extends Validate
protected $message = [];
protected $scene = [
- 'edit' => ['id','kaoshi_id','manfen','youxiu','jige'],
+ 'edit' => ['id','kaoshi_id','manfen','youxiu','lianghao','jige','youxiubi','lianghaobi','jigebi'],
];
}
diff --git a/app/kaoshi/validate/Kaoshiset.php b/app/kaoshi/validate/Kaoshiset.php
index d1ce31ef..c62ea0cc 100755
--- a/app/kaoshi/validate/Kaoshiset.php
+++ b/app/kaoshi/validate/Kaoshiset.php
@@ -19,8 +19,12 @@ class Kaoshiset extends Validate
'nianjiname|年级名称' => 'require|chsAlphaNum',
'subject_id|学科' => 'require|array',
'manfen|满分' => 'require|array',
- 'youxiu|优秀' => 'require|array',
- 'jige|及格' => 'require|array',
+ 'youxiu|优秀分数线' => 'require|array',
+ 'lianghao|良好分数线' => 'require|array',
+ 'jige|及格分数线' => 'require|array',
+ 'youxiubi|优秀人数比' => 'require|array',
+ 'lianghaobi|良好人数比' => 'require|array',
+ 'jigebi|及格人数比' => 'require|array',
// 'lieming|列名' => 'require|array',
];
@@ -33,6 +37,6 @@ class Kaoshiset extends Validate
protected $message = [];
protected $scene = [
- 'create' => ['kaoshi_id', 'nianji','nianjiname', 'subject_id', 'manfen', 'youxiu', 'jige'],
+ 'create' => ['kaoshi_id', 'nianji','nianjiname', 'subject_id', 'manfen', 'youxiu', 'lianghao', 'jige', 'youxiubi', 'lianghaobi', 'jigebi'],
];
}
diff --git a/app/kaoshi/view/index/create_setp2.html b/app/kaoshi/view/index/create_setp2.html
index 8354579b..a4096670 100644
--- a/app/kaoshi/view/index/create_setp2.html
+++ b/app/kaoshi/view/index/create_setp2.html
@@ -1,7 +1,7 @@
{extend name=".././view/create.html" /}
{block name="jscss"}
-
{/block}
{block name="form"}
-
+
+
+
+
{/block}
-
{block name="myjs"}
{/block}
-
diff --git a/app/kaoshi/view/index/index.html b/app/kaoshi/view/index/index.html
index 3a3c36af..165c9f95 100755
--- a/app/kaoshi/view/index/index.html
+++ b/app/kaoshi/view/index/index.html
@@ -160,7 +160,7 @@ layui.use(['table', 'mytable','createInput','form'], function() {
parent.xadmin.add_tab(obj.data.title + ' 分数线', '/kaoshi/kaoshiset/index/' + obj.data.id, true);
break;
case 'kaohao': // 生成考号
- xadmin.open(obj.data.title + ' 生成考号', '/kaohao/index/createall/' + obj.data.id, '650', '400', false);
+ xadmin.open(obj.data.title + ' 生成考号', '/kaohao/index/createall/' + obj.data.id, '550', '300', false);
break;
case 'chengji': // 查询成绩
parent.xadmin.add_tab(obj.data.title + ' 查看成绩', '/kaoshi/index/chengji/' + obj.data.id, true);
diff --git a/app/kaoshi/view/kaoshi_set/create.html b/app/kaoshi/view/kaoshi_set/create.html
index 815deae7..7ba51b32 100755
--- a/app/kaoshi/view/kaoshi_set/create.html
+++ b/app/kaoshi/view/kaoshi_set/create.html
@@ -1,162 +1,141 @@
{extend name=".././view/create.html" /}
-
{block name="form"}
-
+
{/block}
-
{block name="myjs"}
{/block}
-
diff --git a/app/kaoshi/view/kaoshi_set/edit.html b/app/kaoshi/view/kaoshi_set/edit.html
index 126fee1a..9369ad22 100755
--- a/app/kaoshi/view/kaoshi_set/edit.html
+++ b/app/kaoshi/view/kaoshi_set/edit.html
@@ -33,7 +33,16 @@
-
+
{/block}
@@ -69,6 +66,7 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() {
cInput = layui.createInput;
cInput.schoolSelect('school_id', '校级', '校级');
+ cInput.nanjiSelect('ruxuenian');
// 设置列
options.cols = [
@@ -79,13 +77,6 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() {
field: 'banjiTitle',
title: '班级名称',
minWidth: 100,
- templet: function(d) {
- var str = '';
- if (d.grade && d.ban) {
- str = d.grade + d.ban;
- }
- return str;
- }
},
{ field: 'alias', title: '别名', minWidth: 60, edit: 'text' },
{
diff --git a/database/migrations/202001132733_kaoshi_set.php b/database/migrations/202001132733_kaoshi_set.php
index cc030acc..d63d9e45 100755
--- a/database/migrations/202001132733_kaoshi_set.php
+++ b/database/migrations/202001132733_kaoshi_set.php
@@ -38,8 +38,12 @@ class KaoshiSet extends Migrator
->addColumn('nianjiname','string',['limit'=>10,'default'=>'a','null'=>false,'comment'=>'年级名'])
->addColumn('subject_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'学科id'])
->addColumn('manfen','integer',['limit'=>3,'default'=>100,'null'=>false,'comment'=>'满分'])
- ->addColumn('youxiu','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'优秀'])
- ->addColumn('jige','integer',['limit'=>3,'default'=>00,'null'=>false,'comment'=>'及格'])
+ ->addColumn('youxiu','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'优秀分数线'])
+ ->addColumn('lianghao','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'良好分数线'])
+ ->addColumn('jige','integer',['limit'=>3,'default'=>00,'null'=>false,'comment'=>'及格分数线'])
+ ->addColumn('youxiubi','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'优秀人数比'])
+ ->addColumn('lianghaobi','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'良好人数比'])
+ ->addColumn('jigebi','integer',['limit'=>3,'default'=>00,'null'=>false,'comment'=>'及格人数比'])
->addColumn('status','boolean',['default'=>1,'null'=>false,'comment'=>'状态'])
->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间'])
diff --git a/database/migrations/20210215021427_teacher_to_admin.php b/database/migrations/20210215021427_teacher_to_admin.php
index d16aff31..5afe1e31 100644
--- a/database/migrations/20210215021427_teacher_to_admin.php
+++ b/database/migrations/20210215021427_teacher_to_admin.php
@@ -72,11 +72,16 @@ class TeacherToAdmin extends Migrator
$table = $this->table('cj_migrations');
$this->execute('DELETE FROM cj_migrations WHERE version="20210107070200" and migration_name="KaoshiAddUser"');
+
+ $table = $this->table('cj_kaoshi_set');
+ $table->addColumn('youxiubi','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'优秀人数比'])
+ ->addColumn('lianghaobi','integer',['limit'=>3,'default'=>90,'null'=>false,'comment'=>'良好人数比'])
+ ->addColumn('jigebi','integer',['limit'=>3,'default'=>00,'null'=>false,'comment'=>'及格人数比']);
}
//版本退回
- public function down()
+ public function down1()
{
$table = $this->table('fields');
$column = $table->hasColumn('user_group');
diff --git a/public/static/x-admin2.2/js/canyuKaoshi.js b/public/static/x-admin2.2/js/canyuKaoshi.js
index 93dc03fe..e0d640f6 100644
--- a/public/static/x-admin2.2/js/canyuKaoshi.js
+++ b/public/static/x-admin2.2/js/canyuKaoshi.js
@@ -9,7 +9,7 @@ layui.define(['table', 'form', 'upload'], function(exports) {
upload = layui.upload;
var obj = {
- gradeSelect: function(myid, kaoshi_id, hasNull = true) {
+ gradeSelect: function(myid, kaoshi_id, value='', hasNull = true) {
$.ajax({
url: '/kaoshi/kscy/grade',
type: 'POST',
@@ -17,6 +17,7 @@ layui.define(['table', 'form', 'upload'], function(exports) {
kaoshi_id: kaoshi_id
},
success: function(result) {
+ $('#' + myid).children().remove();
if (hasNull == true) {
str = '
';
} else {
@@ -25,9 +26,9 @@ layui.define(['table', 'form', 'upload'], function(exports) {
temp = "";
$(result.data).each(function(i, el) {
if (value != '' && value == el.id) {
- temp = '
';
+ temp = '
';
} else {
- temp = '
';
+ temp = '
';
}
str = str + temp;
});
@@ -42,15 +43,13 @@ layui.define(['table', 'form', 'upload'], function(exports) {
// 参与本次考试学科
- subjectSelect: function(myid, kaoshi_id, ruxuenian, hasNull = true){
+ subjectSelect: function(myid, data, value= '', hasNull = true){
$.ajax({
url: '/kaoshi/kscy/subject',
type: 'POST',
- data: {
- kaoshi_id: kaoshi_id,
- ruxuenian: ruxuenian
- },
+ data: data,
success: function(result) {
+ $('#' + myid).children().remove();
if (hasNull == true) {
str = '
';
} else {
@@ -90,7 +89,7 @@ layui.define(['table', 'form', 'upload'], function(exports) {
}
temp = "";
$(result.data).each(function(i, el) {
- temp = '
';
+ temp = '
';
str = str + temp;
});
$('#' + myid).append(str);
@@ -103,6 +102,68 @@ layui.define(['table', 'form', 'upload'], function(exports) {
},
+ // 已经参与本次考试班级
+ banjiCheckbox: function(myid, data,hasAll = true){
+ $.ajax({
+ url: '/kaoshi/kscy/class',
+ type: 'POST',
+ data: data,
+ success: function(result) {
+ $('#' + myid).children().remove();
+ if (hasAll == true) {
+ str = '
';
+ } else {
+ str = '';
+ }
+ temp = "";
+ $(result.data).each(function(i, el) {
+ temp = '
';
+ str = str + temp;
+ });
+ $('#' + myid).append(str);
+ form.render('checkbox');
+ },
+ error: function(result) {
+ layer.msg('数据扔半道啦。', function() {});
+ },
+ });
+ },
+
+
+ // 参与本次考试学校
+ schoolSelect: function(myid, kaoshi_id, value= '', hasNull = true){
+ $.ajax({
+ url: '/kaoshi/kscy/school',
+ type: 'POST',
+ data: {
+ kaoshi_id:kaoshi_id
+ },
+ success: function(result) {
+ $('#' + myid).children().remove();
+ 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 ea12e827..1b5c38e2 100644
--- a/public/static/x-admin2.2/js/createInput.js
+++ b/public/static/x-admin2.2/js/createInput.js
@@ -22,6 +22,7 @@ layui.extend({
p_id: pid
},
success: function(result) {
+ $('#' + myid).children().remove();
if (hasNull == true) {
str = '
';
} else {
@@ -47,37 +48,43 @@ layui.extend({
// 选中checkbox
checkboxChecked: function(data) {
- pid = $(data.elem).attr('pid');
+ pid = $(data.elem).attr('pid');
cid = $(data.elem).attr('cid');
check = data.elem.checked;
editCid(cid, check);
editPid(pid, check);
function editCid(cid, check) {
- $("input[pid='" + cid + "']").each(function(i, el) {
+ myInput = $(data.elem).siblings("input[pid='" + cid + "']");
+ myInput.each(function(i, el) {
this.checked = check;
cid = $(this).attr('cid');
editCid(cid, check);
});
+ return false;
}
function editPid(pid, check) {
+ myInput = $(data.elem).siblings("input[pid='" + pid + "']");
if (check == true) {
- $("input[cid='" + pid + "']").each(function(i, el) {
+ myInput.each(function(i, el) {
this.checked = check;
pid = $(this).attr('pid');
+ console.log(pid);
editPid(pid, check);
});
} else {
- cnt = $("input[pid='" + pid + "']:checked").length;
+ myCid = $(data.elem).siblings("input[pid='" + pid + "']");
+ cnt = myInput.length;
if (cnt == 0) {
- $("input[cid='" + pid + "']").each(function(i, el) {
+ myInput.each(function(i, el) {
this.checked = check;
pid = $(this).attr('pid');
editPid(pid, check);
});
}
}
+ return false;
}
form.render('checkbox');
@@ -95,6 +102,7 @@ layui.extend({
kaoshi:kaoshi
},
success: function(result) {
+ $('#' + myid).children().remove();
if (hasNull == true) {
str = '
';
} else {
@@ -303,6 +311,7 @@ layui.extend({
kaoshi: kaoshi
},
success: function(result) {
+ $('#' + myid).children().remove();
if (hasNull == true) {
str = '
';
} else {
@@ -343,9 +352,9 @@ layui.extend({
temp = "";
$(result.data).each(function(i, el) {
if (value != '' && value == el.id) {
- temp = '
';
+ temp = '
';
} else {
- temp = '
';
+ temp = '
';
}
str = str + temp;
});
@@ -391,13 +400,14 @@ layui.extend({
},
- // 创建学期的Select
+ // 创建年级的Select
nanjiSelect: function(myid, data, value, hasNull = true) {
$.ajax({
url: '/teach/banji/njlist',
type: 'POST',
data: data,
success: function(result) {
+ $('#' + myid).children().remove();
if (hasNull == true) {
str = '
';
} else {
@@ -428,6 +438,7 @@ layui.extend({
url: '/teach/xueqi/srcxueqi',
type: 'POST',
success: function(result) {
+ $('#' + myid).children().remove();
if (hasNull == true) {
str = '
';
} else {