diff --git a/app/student/controller/Index.php b/app/student/controller/Index.php
index 1f77b192..503ee7a1 100755
--- a/app/student/controller/Index.php
+++ b/app/student/controller/Index.php
@@ -100,7 +100,9 @@ class Index extends AdminBase
// 根据条件查询数据
$stu = new STU;
$data = $stu->searchBy($src);
- $data = reSetObject($data, $src);
+ $src['all'] = true;
+ $cnt = $stu->searchBy($src)->count();
+ $data = reset_data($data, $cnt);
return json($data);
}
@@ -144,7 +146,9 @@ class Index extends AdminBase
// 实例化
$stu = new STU;
$data = $stu->searchDel($src);
- $data = reSetObject($data, $src);
+ $src['all'] = true;
+ $cnt = $stu->searchDel($src)->count();
+ $data = reset_data($data, $cnt);
return json($data);
}
diff --git a/app/student/model/Student.php b/app/student/model/Student.php
index 3cec4f1a..0b88f76d 100755
--- a/app/student/model/Student.php
+++ b/app/student/model/Student.php
@@ -9,6 +9,31 @@ use app\teach\model\Banji;
class Student extends BaseModel
{
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'xingming' => 'varchar'
+ ,'sex' => 'tinyint'
+ ,'shengri' => 'int'
+ ,'shenfenzhenghao' => 'varchar'
+ ,'password' => 'varchar'
+ ,'denglucishu' => 'int'
+ ,'lastip' => 'varchar'
+ ,'ip' => 'varchar'
+ ,'lasttime' => 'int'
+ ,'thistime' => 'int'
+ ,'banji_id' => 'int'
+ ,'kaoshi' => 'tinyint'
+ ,'quanpin' => 'varchar'
+ ,'shoupin' => 'varchar'
+ ,'xuehao' => 'varchar'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ,'status' => 'tinyint'
+ ];
+
+
// 班级关联
public function stuBanji()
{
@@ -175,6 +200,11 @@ class Student extends BaseModel
'check' => true
,'banji_id' => array()
]
+ ,'page' => 1
+ ,'limit' => 10
+ ,'field' => 'id'
+ ,'order' => 'desc'
+ ,'all' => false
];
$src = array_cover($srcfrom, $src);
@@ -228,6 +258,11 @@ class Student extends BaseModel
}
])
->field('id, xingming, sex, shengri, banji_id, kaoshi, status, update_time')
+ ->when($src['all'] == false, function ($query) use($src) {
+ $query
+ ->page($src['page'], $src['limit']);
+ })
+ ->order([$src['field'] => $src['order']])
->append(['age'])
->select();
@@ -244,6 +279,11 @@ class Student extends BaseModel
'check' => true
,'banji_id' => array()
]
+ ,'page' => 1
+ ,'limit' => 10
+ ,'field' => 'id'
+ ,'order' => 'desc'
+ ,'all' => false
];
$src = array_cover($srcfrom, $src);
@@ -270,6 +310,11 @@ class Student extends BaseModel
}
])
->field('id, xingming, sex, shengri, banji_id, status')
+ ->when($src['all'] == false, function ($query) use($src) {
+ $query
+ ->page($src['page'], $src['limit']);
+ })
+ ->order([$src['field'] => $src['order']])
->append(['age'])
->select();
diff --git a/app/student/view/index/del_list.html b/app/student/view/index/del_list.html
index 6c628a24..f3c75629 100755
--- a/app/student/view/index/del_list.html
+++ b/app/student/view/index/del_list.html
@@ -92,7 +92,7 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() {
}
},
{
- field: 'banji',
+ field: 'banji_id',
title: '班级',
sort: true,
templet: function(d) {
diff --git a/app/system/model/Category.php b/app/system/model/Category.php
index e48eefc5..5bf9005a 100755
--- a/app/system/model/Category.php
+++ b/app/system/model/Category.php
@@ -6,8 +6,20 @@ use app\BaseModel;
class Category extends BaseModel
{
- // 关闭全局自动时间戳
- // protected $autoWriteTimestamp = false;
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'title' => 'varchar'
+ ,'p_id' => 'int'
+ ,'status' => 'tinyint'
+ ,'paixu' => 'int'
+ ,'isupdate' => 'tinyint'
+ ,'beizhu' => 'varchar'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ];
+
// 父级类型关联
public function glPid()
diff --git a/app/system/model/Fields.php b/app/system/model/Fields.php
index 1f8630e6..ebed4d95 100755
--- a/app/system/model/Fields.php
+++ b/app/system/model/Fields.php
@@ -6,6 +6,24 @@ use app\BaseModel;
class Fields extends BaseModel
{
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'category_id' => 'int'
+ ,'oldname' => 'varchar'
+ ,'bianjitime' => 'int'
+ ,'newname' => 'varchar'
+ ,'extension' => 'varchar'
+ ,'fieldsize' => 'int'
+ ,'hash' => 'varchar'
+ ,'user_group' => 'varchar'
+ ,'user_id' => 'int'
+ ,'url' => 'varchar'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ];
+
// 编辑时间获取器
public function getBianjitimeAttr($value)
diff --git a/app/system/model/School.php b/app/system/model/School.php
index 73bd09d5..ca926ee7 100755
--- a/app/system/model/School.php
+++ b/app/system/model/School.php
@@ -6,6 +6,24 @@ use app\BaseModel;
class School extends BaseModel
{
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'title' => 'varchar'
+ ,'jiancheng' => 'varchar'
+ ,'biaoshi' => 'varchar'
+ ,'xingzhi_id' => 'int'
+ ,'jibie_id' => 'int'
+ ,'xueduan_id' => 'int'
+ ,'kaoshi' => 'tinyint'
+ ,'status' => 'tinyint'
+ ,'paixu' => 'int'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ,'beizhu' => 'varchar'
+ ];
+
// 教师数据模型关联
public function dwAdmin()
diff --git a/app/teach/model/BanZhuRen.php b/app/teach/model/BanZhuRen.php
index 3c9f4d07..a9766832 100755
--- a/app/teach/model/BanZhuRen.php
+++ b/app/teach/model/BanZhuRen.php
@@ -11,6 +11,19 @@ use app\BaseModel;
*/
class BanZhuRen extends BaseModel
{
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'teacher_id' => 'int'
+ ,'banji_id' => 'int'
+ ,'bfdate' => 'int'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ,'beizhu' => 'varchar'
+ ];
+
+
// 教师关联模型
public function glAdmin()
{
diff --git a/app/teach/model/Banji.php b/app/teach/model/Banji.php
index 84ff82c6..772ead1d 100755
--- a/app/teach/model/Banji.php
+++ b/app/teach/model/Banji.php
@@ -7,6 +7,21 @@ use app\BaseModel;
class Banji extends BaseModel
{
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'school_id' => 'int'
+ ,'ruxuenian' => 'int'
+ ,'xueduan_id' => 'int'
+ ,'paixu' => 'int'
+ ,'alias' => 'varchar'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ,'status' => 'tinyint'
+ ];
+
+
// 查询所有班级
public function search($srcfrom)
diff --git a/app/teach/model/JiaoyanZuzhang.php b/app/teach/model/JiaoyanZuzhang.php
index c40fbae6..c5363b2d 100644
--- a/app/teach/model/JiaoyanZuzhang.php
+++ b/app/teach/model/JiaoyanZuzhang.php
@@ -10,6 +10,19 @@ use think\Model;
*/
class JiaoyanZuzhang extends Model
{
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'teacher_id' => 'int'
+ ,'jiaoyanzu_id' => 'int'
+ ,'bfdate' => 'int'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ,'beizhu' => 'varchar'
+ ];
+
+
// 教师关联
public function glTeacher()
{
diff --git a/app/teach/model/Jiaoyanzu.php b/app/teach/model/Jiaoyanzu.php
index 646ece9f..56033889 100644
--- a/app/teach/model/Jiaoyanzu.php
+++ b/app/teach/model/Jiaoyanzu.php
@@ -10,6 +10,22 @@ use app\BaseModel;
*/
class Jiaoyanzu extends BaseModel
{
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'title' => 'varchar'
+ ,'ruxuenian' => 'int'
+ ,'category_id' => 'int'
+ ,'school_id' => 'int'
+ ,'subject_id' => 'varchar'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ,'beizhu' => 'varchar'
+ ,'status' => 'tinyint'
+ ];
+
+
// 分类关联
public function glCategory()
{
diff --git a/app/teach/model/KeChengBiao.php b/app/teach/model/KeChengBiao.php
index 861dce35..cd87d4c8 100755
--- a/app/teach/model/KeChengBiao.php
+++ b/app/teach/model/KeChengBiao.php
@@ -11,5 +11,16 @@ use app\BaseModel;
*/
class KeChengBiao extends BaseModel
{
- //
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'xueqi_id' => 'int'
+ ,'banji_id' => 'int'
+ ,'subject_id' => 'int'
+ ,'teacher_id' => 'int'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ,'beizhu' => 'varchar'
+ ];
}
diff --git a/app/teach/model/Subject.php b/app/teach/model/Subject.php
index 024eb615..b5042654 100755
--- a/app/teach/model/Subject.php
+++ b/app/teach/model/Subject.php
@@ -6,6 +6,22 @@ use app\BaseModel;
class Subject extends BaseModel
{
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'title' => 'varchar'
+ ,'jiancheng' => 'varchar'
+ ,'lieming' => 'varchar'
+ ,'category_id' => 'int'
+ ,'kaoshi' => 'tinyint'
+ ,'paixu' => 'int'
+ ,'status' => 'tinyint'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ];
+
+
// 按条件查询学科
public function search($srcfrom)
{
diff --git a/app/teach/model/Xueqi.php b/app/teach/model/Xueqi.php
index 1b92a028..ab3f3c75 100755
--- a/app/teach/model/Xueqi.php
+++ b/app/teach/model/Xueqi.php
@@ -7,7 +7,23 @@ use app\BaseModel;
class Xueqi extends BaseModel
{
- // 开始时间修改器
+ // 设置字段信息
+ protected $schema = [
+ 'id' => 'int'
+ ,'title' => 'varchar'
+ ,'xuenian' => 'varchar'
+ ,'category_id' => 'int'
+ ,'bfdate' => 'int'
+ ,'enddate' => 'int'
+ ,'status' => 'tinyint'
+ ,'create_time' => 'int'
+ ,'update_time' => 'int'
+ ,'delete_time' => 'int'
+ ,'beizhu' => 'varchar'
+ ];
+
+
+ // 开始时间修改器
public function setBfdateAttr($value)
{
return strtotime($value);
diff --git a/public/static/x-admin2.2/js/createInput.js b/public/static/x-admin2.2/js/createInput.js
index ad527747..56279462 100644
--- a/public/static/x-admin2.2/js/createInput.js
+++ b/public/static/x-admin2.2/js/createInput.js
@@ -637,15 +637,18 @@ layui.extend({
} else {
str = '';
}
- temp = "";
- $(result.data).each(function(i, el) {
- if (value != '' && value == el.id) {
- temp = '';
+
+ var data = result.data;
+ for (var key in data) {
+ temp = "";
+ if (value != '' && value == data[key].id) {
+ temp = '';
} else {
- temp = '';
+ temp = '';
}
str = str + temp;
- });
+ }
+
$('#' + myid).append(str);
form.render('checkbox');
},
@@ -669,15 +672,18 @@ layui.extend({
} else {
str = '';
}
- temp = "";
- $(result.data).each(function(i, el) {
- if (value != '' && value == el.id) {
- temp = '';
+
+ var data = result.data;
+ for (var key in data) {
+ temp = "";
+ if (value != '' && value == data[key].id) {
+ temp = '';
} else {
- temp = '';
+ temp = '';
}
str = str + temp;
- });
+ }
+
$('#' + myid).append(str);
form.render('select');
},