-
-
layui.use(['laydate','form'], function(){
var laydate = layui.laydate
,form = layui.form;
//执行一个laydate实例
laydate.render({
elem: '#shengri' //指定元素
+ ,trigger: 'click' //采用click弹出
});
// 监听选择按钮
@@ -194,15 +193,30 @@ layui.use(['laydate','form'], function(){
});
}
});
+ }
-
-}
+ $('#shenfenzhenghao').bind('change',function sfz(){
+ // 获取身份证号 210281198510288213
+ var str = $(this).val();
+ // 如果身份证号为18位则自动填表
+ if(str.length == 18){
+ // 填写性别
+ var sex = str.substr(16,1) % 2;
+ if(sex == 1){
+ // 选择性别男
+ $("input[name='sex']:first").prop('checked', true);
+ }else{
+ // 选择性别女
+ $("input[name='sex']:last").prop('checked', true);
+ }
+ form.render('radio');
+ // 填写出生日期
+ $("#shengri").val(str.substr(6,4) +'-'+ str.substr(10,2) +'-'+ str.substr(12,2));
+ $("#school").focus();
+ }
+ })
});
-
-
-
-
{/block}
diff --git a/application/rongyu/controller/DwRongyu.php b/application/rongyu/controller/DwRongyu.php
index bb885e57..d14b9fff 100644
--- a/application/rongyu/controller/DwRongyu.php
+++ b/application/rongyu/controller/DwRongyu.php
@@ -142,7 +142,7 @@ class DwRongyu extends Base
* @return \think\Response
*/
// 批量添加
- public function createAll()
+ public function saveall()
{
// 设置页面标题
$list['set'] = array(
diff --git a/application/rongyu/controller/JsRongyuInfo.php b/application/rongyu/controller/JsRongyuInfo.php
index a020841f..649290b9 100644
--- a/application/rongyu/controller/JsRongyuInfo.php
+++ b/application/rongyu/controller/JsRongyuInfo.php
@@ -202,7 +202,7 @@ class JsRongyuInfo extends Base
}
// 保存批传
- public function createAllSave($rongyuce)
+ public function saveall($rongyuce)
{
// 获取文件信息
$list['text'] = $this->request->post('text');
diff --git a/application/teach/model/Banji.php b/application/teach/model/Banji.php
index d9f5ff28..ec42b631 100644
--- a/application/teach/model/Banji.php
+++ b/application/teach/model/Banji.php
@@ -33,11 +33,13 @@ class Banji extends Base
'glSchool'=>function($query){
$query->field('id,title');
},
- 'glStudent'=>function($query){
- $query->count();
- },
]
)
+ ->withCount([
+ 'glStudent'=>function($query){
+ $query->where('status',1);
+ }
+ ])
->append(['title'])
->select();
return $data;
@@ -90,21 +92,6 @@ class Banji extends Base
}
-
-
-
-
- // 学校获取器
- // public function getSchoolAttr($value)
- // {
- // // 查询学校名称
- // $schoolname = db('school')->where('id',$value)->value('title');
- // // 返回学校名称
- // return $schoolname;
- // }
-
-
-
// 班级学生数
public function getStusumAttr()
{
diff --git a/application/teach/view/banji/index.html b/application/teach/view/banji/index.html
index 982d7463..b24f3b56 100644
--- a/application/teach/view/banji/index.html
+++ b/application/teach/view/banji/index.html
@@ -89,7 +89,7 @@ layui.use(['table','laypage','form','cjgl'], function(){
cols: [[ //表头
{type:'checkbox', fixed: 'left'},
{field: 'id', title: 'ID', minWidth:100,sort: true},
- {field: 'title', title: '班级名称', minWidth:100,sort: true},
+ {field: 'title', title: '班级名称', minWidth:100},
{field: 'school', title: '单位名称',sort: true, minWidth:240,templet:function(d){
var str='';
if(d.gl_school)
@@ -100,14 +100,7 @@ layui.use(['table','laypage','form','cjgl'], function(){
}},
{field: "ruxuenian",title: '入学年',sort: true},
{field: 'paixu', title: '排序', sort: true},
- {title: '班级学生数',sort: true,templet:function(d){
- var str='';
- if(d.gl_student)
- {
- str = d.gl_student;
- }
- return str;
- }},
+ {field:"gl_student_count",title: '班级学生数',sort: true},
{field: 'status', title: '状态',templet:'#status', sort: true},
{field: 'id', title: '操作',toolbar: '#barDemo',minWidth:160}
]],
diff --git a/application/teach/view/xueqi/create.html b/application/teach/view/xueqi/create.html
index 8cc136db..7fd22178 100644
--- a/application/teach/view/xueqi/create.html
+++ b/application/teach/view/xueqi/create.html
@@ -45,10 +45,10 @@
*时间范围
-
+
-
+