修改考试列表显示项、增加分配考号时间验证

This commit is contained in:
cxdbz committed 2019-11-23 15:34:42 +08:00
1 parent a877f2bb3c
commit 335984deac
3 files changed
+36 -8

No files matched your search

+17
View File
@@ -1,4 +1,21 @@
<?php
// 验证考试是否结束
function enddate($kaoshiid)
{
$ks = new app\kaoshi\model\Kaoshi;
$enddate = $ks->where('id',$kaoshiid)->value('enddate');
$thistime = time();
if($enddate<time())
{
$data = false;
}else{
$data = true;
}
return $data;
}
+11
View File
@@ -14,6 +14,9 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
// 引用二维码生成类
use \Endroid\QrCode\QrCode;
// 调用验证类
use think\Validate;
class Kaohao extends Base
{
@@ -58,6 +61,7 @@ class Kaohao extends Base
// 保存考号
public function save()
{
// 实例化验证模型
$validate = new \app\kaoshi\validate\Kaohao;
@@ -74,6 +78,13 @@ class Kaohao extends Base
return ['msg'=>$msg,'val'=>0];
}
if(enddate($list['kaoshi'])==false)
{
return ['msg'=>'考试已经结束,不能分配考号','val'=>0];
}
// 将班级转换成数组
$list['banjiids'] = implode(',',$list['banjiids']);
$ksid = $list['kaoshi'];
+8 -8
View File
@@ -53,14 +53,14 @@
options.cols=[[ //表头
{type:'checkbox', fixed: 'left'},
{field: 'title', title: '单位名称',sort: true, minWidth:240},
{field: 'category', title: '考试分类', minWidth:100,sort: true,templet:function(d){
var str='';
if(d.ks_category)
{
str = d.ks_category.title;
}
return str;
}},
// {field: 'category', title: '考试分类', minWidth:100,sort: true,templet:function(d){
// var str='';
// if(d.ks_category)
// {
// str = d.ks_category.title;
// }
// return str;
// }},
{field: "",title: '参考年级', minWidth:160,templet:function(d){
var str='';
if(d.ks_nianji.length>0)