扫码录入成绩和下载扫码信息表完成
This commit is contained in:
1 parent
1655d11b94
commit
99d2cb688a
16 files changed
+287
-106
No files matched your search
@@ -3,18 +3,53 @@ namespace app\chengji\controller;
|
||||
|
||||
// 引用控制器基类
|
||||
use app\common\controller\Base;
|
||||
// 引用学生类
|
||||
// 引用学生数据模型
|
||||
use app\renshi\model\Student;
|
||||
// 引用成绩类
|
||||
// 引用成绩数据模型
|
||||
use app\chengji\model\Chengji;
|
||||
// 引用考试数据模型
|
||||
|
||||
class Index extends Base
|
||||
{
|
||||
// 导出参加考试学生二维码
|
||||
public function erweima()
|
||||
// 使用二维码录入成绩
|
||||
public function malu()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 保存使用二维码录入的成绩
|
||||
public function malusave()
|
||||
{
|
||||
// 获取表单数据
|
||||
$list = request()->only(['id','ziduan','defen'],'post');
|
||||
$zd = $list['ziduan'];
|
||||
|
||||
// 更新成绩
|
||||
$cj = Chengji::update(['id'=>$list['id'], $zd=>$list['defen']]);
|
||||
|
||||
empty($cj) ? $data = ['val' => 0] : $data = ['val' => 1];
|
||||
|
||||
return json($data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 根据考号获取学生信息
|
||||
public function read()
|
||||
{
|
||||
$list = request()->only(['id','ziduan'],'post');
|
||||
$zd = $list['ziduan'];
|
||||
$stuinfo = Chengji::where('id',$list['id'])
|
||||
->field('id,school,student,banji,'.$zd)
|
||||
->append(['studentname','schooljian','banjiname'])
|
||||
->find();
|
||||
return json($stuinfo->visible(['studentname','schooljian','banjiname','banji',$zd]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -4,9 +4,30 @@ namespace app\chengji\model;
|
||||
|
||||
// 引用基类
|
||||
use app\common\model\Base;
|
||||
// 引用班级类
|
||||
use app\teach\model\Banji;
|
||||
|
||||
|
||||
class Chengji extends Base
|
||||
{
|
||||
//
|
||||
// 学生姓名获取器
|
||||
public function getStudentnameAttr()
|
||||
{
|
||||
return db('student')->where('id',$this->student)->value('xingming');
|
||||
}
|
||||
|
||||
// 学校简称获取器
|
||||
public function getSchooljianAttr()
|
||||
{
|
||||
return db('school')->where('id',$this->school)->value('jiancheng');
|
||||
}
|
||||
|
||||
// 班级名称获取器
|
||||
public function getBanjinameAttr()
|
||||
{
|
||||
$bj = Banji::get($this->banji);
|
||||
|
||||
// 返回班级名称
|
||||
return $bj->title;
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
{extend name="common@create" /}
|
||||
{block name="formaa"}
|
||||
<form action="/xueqi" method="POST" class="form form-horizontal" id="form-member-add">
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>标题:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<input type="text" class="input-text" value="" placeholder="标题" id="title" name="title">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>学年:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<input type="text" class="input-text" value="" placeholder="例如:2018-2019学年度" id="xuenian" name="xuenian">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>分类:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9 f-l">
|
||||
<span class="select-box f-l" style="width:180px;">
|
||||
{php}$list = getCategory(108);{/php}
|
||||
<select class="select" id="category" name="category" size="1">
|
||||
<option value="">--请选择学期分类--</option>
|
||||
{volist name="list" id="vo"}
|
||||
<option value="{$vo.id}">{$vo.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>起始时间:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<input type="text" class="input-text Wdate" style="max-width:120px" value="" placeholder="" id="bfdate" name="bfdate" onclick="WdatePicker({isShowClear:false,readOnly:true})">
|
||||
<span class="ml-10">~</span>
|
||||
<input type="text" class="input-text Wdate ml-10" style="max-width:120px" value="" placeholder="" id="enddate" name="enddate" onclick="WdatePicker({isShowClear:false,readOnly:true})">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
|
||||
<input class="btn btn-primary radius" type="submit" value=" 提交 ">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
{block name="yanzheng"}
|
||||
<script type="text/javascript">
|
||||
// 设置表单验证规则
|
||||
var myrules = {
|
||||
title:{
|
||||
required:true,
|
||||
rangelength:[2,25]
|
||||
},
|
||||
xuenian:{
|
||||
required:true,
|
||||
rangelength:[1,15]
|
||||
},
|
||||
category:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
bfdate:{
|
||||
required:true,
|
||||
dateISO:true
|
||||
},
|
||||
enddate:{
|
||||
required:true,
|
||||
dateISO:true
|
||||
},
|
||||
};
|
||||
|
||||
// 设置表单提交方式
|
||||
var mytype = 'POST';
|
||||
</script>
|
||||
{/block}
|
||||
Loaded 3 of 16 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user