diff --git a/app/admin/validate/Admin.php b/app/admin/validate/Admin.php
index e115547e..eee7fb48 100755
--- a/app/admin/validate/Admin.php
+++ b/app/admin/validate/Admin.php
@@ -23,7 +23,7 @@ class Admin extends Validate
'sex|性别' => 'require|in:0,1,2',
'phone|手机号' => 'require|mobile|unique:admin',
'beizhu|备注' => 'max:80',
- 'zhiwu_id|职务' => 'require|number',
+ 'zhiwu_id|职务' => 'number',
'zhicheng_id|职称' => 'require|number',
'xueli_id|学历' => 'require|number',
'biye|毕业院校' => 'length:1,50',
diff --git a/app/admin/view/index/create.html b/app/admin/view/index/create.html
index d9b0d1c9..e69bf615 100755
--- a/app/admin/view/index/create.html
+++ b/app/admin/view/index/create.html
@@ -68,9 +68,9 @@
{/php}
{volist name="authgrouplist" id="vo"}
{/volist}
diff --git a/app/student/view/index/by_list.html b/app/student/view/index/by_list.html
index ffb11dbf..7fc38579 100755
--- a/app/student/view/index/by_list.html
+++ b/app/student/view/index/by_list.html
@@ -127,7 +127,7 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() {
table.on('toolbar(mytable)', function(obj) {
switch (obj.event) {
case 'dels':
- layer.msg('这个~算了吧!');
+ layer.msg('人都已经毕业了,还删他作甚?');
break;
var checkStatus = table.checkStatus('mytable'); //idmytable 即为基础参数 id 对应的值
mytable.delAll(checkStatus, '/student/index/delete', 'mytable');
diff --git a/app/system/view/system_base/edit.html b/app/system/view/system_base/edit.html
index 6e1acb45..88c553cf 100755
--- a/app/system/view/system_base/edit.html
+++ b/app/system/view/system_base/edit.html
@@ -151,22 +151,24 @@
// 初始化系统
function resetMayi() {
layer.confirm('初始化系统会删除原来的数据,确定要继续操作吗?', { btn: ['我确定要继续删除!', '我再想想'] }, function(index) {
- $.ajax({
- url: '/system/reset',
- type: 'POST',
- dataType: 'json',
- success: function(result) {
- // 弹出提示
- layer.msg(result.msg);
- },
- error: function(xhr, status, error) {
- layer.msg('数据处理错误', {
- icon: 2,
- time: 2000 //2秒关闭(如果不配置,默认是3秒)
- });
- }
- });
- });
+ $.ajax({
+ url: '/system/reset',
+ type: 'POST',
+ dataType: 'json',
+ success: function(result) {
+ // 弹出提示
+ layer.msg(result.msg);
+ },
+ error: function(xhr, status, error) {
+ layer.msg('数据处理错误', {
+ icon: 2,
+ time: 2000 //2秒关闭(如果不配置,默认是3秒)
+ });
+ }
+ });
+ },
+ function (){}
+ )
return false;
}
diff --git a/app/teach/controller/JiaoyanZuzhang.php b/app/teach/controller/JiaoyanZuzhang.php
index 0529893e..2a20d4d5 100644
--- a/app/teach/controller/JiaoyanZuzhang.php
+++ b/app/teach/controller/JiaoyanZuzhang.php
@@ -57,7 +57,10 @@ class JiaoyanZuzhang extends AdminBase
,'bfdate'
,'update_time'
]); # 查询数据
- $data = reSetObject($data, $src);
+
+ $src['all'] = true;
+ $cnt = $jyzzmod->search($src)->count();
+ $data = reset_data($data, $cnt);
// 返回数据
return json($data);
@@ -88,7 +91,7 @@ class JiaoyanZuzhang extends AdminBase
/**
- * 保存班级
+ * 保存教研组长
*
* @return \think\Response
*/
@@ -128,7 +131,7 @@ class JiaoyanZuzhang extends AdminBase
}
- // 修改学期信息
+ // 修改教研组长信息
public function edit($id)
{
// 获取学期信息
@@ -171,7 +174,7 @@ class JiaoyanZuzhang extends AdminBase
}
- // 更新学期信息
+ // 更新教研组长信息
public function update($id)
{
// 获取表单数据
diff --git a/app/teach/model/JiaoyanZuzhang.php b/app/teach/model/JiaoyanZuzhang.php
index 2f24f181..6d61d619 100644
--- a/app/teach/model/JiaoyanZuzhang.php
+++ b/app/teach/model/JiaoyanZuzhang.php
@@ -1,6 +1,4 @@
''
,'category_id' => ''
,'status' => ''
+ ,'page' => 1
+ ,'limit' => 10
+ ,'field' => 'id'
+ ,'order' => 'desc'
+ ,'all' => false
];
$src = array_cover($srcfrom, $src) ;
@@ -76,6 +79,11 @@ class JiaoyanZuzhang extends Model
},
]
)
+ ->when($src['all'] == false, function ($query) use($src) {
+ $query
+ ->page($src['page'], $src['limit']);
+ })
+ ->order([$src['field'] => $src['order']])
->select();
return $data;
diff --git a/app/teach/validate/JiaoyanZuzhang.php b/app/teach/validate/JiaoyanZuzhang.php
index 69c1de47..121c6485 100644
--- a/app/teach/validate/JiaoyanZuzhang.php
+++ b/app/teach/validate/JiaoyanZuzhang.php
@@ -14,6 +14,7 @@ class JiaoyanZuzhang extends Validate
* @var array
*/
protected $rule = [
+ 'id|ID' => 'require',
'teacher_id|教师' => 'require|number',
'jiaoyanzu_id|教研组' => 'require|number',
'bfdate|开始时间' => 'require|date',
@@ -33,5 +34,10 @@ class JiaoyanZuzhang extends Validate
,'jiaoyanzu_id'
,'bfdate'
],
+ 'edit' => [
+ 'id'
+ ,'teacher_id'
+ ,'bfdate'
+ ],
];
}
diff --git a/app/teach/view/banji/index.html b/app/teach/view/banji/index.html
index d9a1e8d0..baa7442a 100755
--- a/app/teach/view/banji/index.html
+++ b/app/teach/view/banji/index.html
@@ -152,7 +152,12 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() {
case 'del': // 删除
// layer.msg('暂时不允许删除');
// break;
- mytable.del(obj, "/teach/banji/delete");
+ layer.confirm('删除班级会造成数据混乱,确定要继续吗?', { btn: ['我确定!', '再想想'] },
+ function () {
+ mytable.del(obj, "/teach/banji/delete");
+ },
+ function (){}
+ );
break;
case 'edit': // 编辑
xadmin.open('编辑班级', '/teach/banji/edit/' + obj.data.id, '600', '300');
diff --git a/app/teacher/controller/Index.php b/app/teacher/controller/Index.php
deleted file mode 100644
index 5b33facb..00000000
--- a/app/teacher/controller/Index.php
+++ /dev/null
@@ -1,533 +0,0 @@
-view->assign('list', $list);
-
- // 渲染模板
- return $this->view->fetch();
- }
-
-
- /**
- * 显示教师信息列表
- *
- * @return \think\Response
- */
- public function ajaxData()
- {
- // 获取参数
- $src = $this->request
- ->only([
- 'page' => '1'
- ,'limit' => '10'
- ,'field' => 'update_time'
- ,'order' => 'desc'
- ,'zhiwu_id' => array()
- ,'danwei_id' => array()
- ,'xueli_id' => array()
- ,'tuixiu' => 0
- ,'zhicheng_id' => ''
- ,'searchval' => ''
- ], 'POST');
-
- // 实例化
- $teacher = new TC;
- $data = $teacher->search($src)
- ->visible([
- 'id'
- ,'xingming'
- ,'sex'
- ,'jsXueli' => ['title']
- ,'jsZhiwu' => ['title']
- ,'jsZhicheng' => ['title']
- ,'jsDanwei' => ['jiancheng']
- ,'biye'
- ,'zhuanye'
- ,'status'
- ,'phone'
- ,'update_time'
- ]);
-
- $data = reSetObject($data, $src);
-
- return json($data);
- }
-
-
- // 显示教师列表
- public function delList()
- {
- // 设置要给模板赋值的信息
- $list['webtitle'] = '教师列表';
- $list['dataurl'] = '/teacher/index/datadel';
- $list['status'] = '/teacher/index/status';
-
- // 模板赋值
- $this->view->assign('list', $list);
-
- // 渲染模板
- return $this->view->fetch();
- }
-
-
- /**
- * 显示教师信息列表
- *
- * @return \think\Response
- */
- public function ajaxDataDel()
- {
- // 获取参数
- $src = $this->request
- ->only([
- 'page' => '1'
- ,'limit' => '10'
- ,'field' => 'update_time'
- ,'order' => 'desc'
- ,'zhiwu_id' => array()
- ,'danwei_id' => array()
- ,'xueli_id' => array()
- ,'searchval' => ''
- ], 'POST');
-
- // 实例化
- $teacher = new TC;
- $data = $teacher->searchDel($src)
- ->visible([
- 'id'
- ,'xingming'
- ,'sex'
- ,'jsXueli' => ['title']
- ,'jsZhiwu' => ['title']
- ,'jsZhicheng' => ['title']
- ,'jsDanwei' => ['jiancheng']
- ,'biye'
- ,'zhuanye'
- ,'update_time'
- ]);
- $data = reSetObject($data, $src);
-
- return json($data);
- }
-
-
- // 创建教师
- public function create()
- {
- // 设置页面标题
- $list['set'] = array(
- 'webtitle' => '添加教师'
- ,'butname' => '添加'
- ,'formpost' => 'POST'
- ,'url' => 'save'
- );
-
- // 模板赋值
- $this->view->assign('list', $list);
- // 渲染
- return $this->view->fetch('create');
- }
-
-
- // 保存信息
- public function save()
- {
- // 获取表单数据
- $list = request()->only([
- 'xingming'
- ,'sex'
- ,'quanpin'
- ,'shoupin'
- ,'shengri'
- ,'phone'
- ,'zhiwu_id'
- ,'zhicheng_id'
- ,'xueli_id'
- ,'biye'
- ,'worktime'
- ,'zhuanye'
- ,'danwei_id'
- ,'tuixiu'
- ], 'POST');
-
- // 验证表单数据
- $validate = new \app\teacher\validate\Teacher;
- $result = $validate->scene('create')->check($list);
- $msg = $validate->getError();
- if(!$result){
- return json(['msg' => $msg, 'val' => 0]);
- }
-
- $tc = new TC();
- $temp = $tc->phoneSrc($list['phone']);
- if($temp)
- {
- return json(['msg' => '手机号已经存在', 'val' => 0]);
- }
-
- $list['quanpin'] = trim(strtolower(str_replace(' ', '', $list['quanpin'])));
- $list['shoupin'] = trim(strtolower($list['shoupin']));
-
- // 保存数据
- $data = TC::create($list);
- $data ? $data = ['msg' => '添加成功', 'val' => 1]
- : $data = ['msg' => '数据处理错误', 'val' => 0];
-
- // 返回信息
- return json($data);
- }
-
-
- // 查看教师信息
- public function read($id)
- {
- // 查询教师信息
- $myInfo = TC::withTrashed()
- ->where('id', $id)
- ->with(
- [
- 'jsDanwei' => function($query){
- $query->field('id, title');
- },
- 'jsZhiwu' => function($query){
- $query->field('id, title');
- },
- 'jsZhicheng' => function($query){
- $query->field('id, title');
- },
- 'jsXueli' => function($query){
- $query->field('id, title');
- },
- 'jsSubject' => function($query){
- $query->field('id, title');
- },
- ]
- )
- ->append(['age', 'gongling'])
- ->limit(1)
- ->find();
-
- // 设置页面标题
- $myInfo['webtitle'] = $myInfo->xingming . '信息';
-
- // 模板赋值
- $this->view->assign('list', $myInfo);
- // 渲染模板
- return $this->view->fetch();
- }
-
-
- // 修改教师信息
- public function edit($id)
- {
- // 获取教师信息
- $list['data'] = TC::field('id, xingming, sex, quanpin, shoupin, shengri, phone, zhiwu_id, zhicheng_id, xueli_id, biye, worktime, zhuanye, danwei_id, tuixiu')
- ->find($id);
-
- // 设置页面标题
- $list['set'] = array(
- 'webtitle' => '编辑教师'
- ,'butname' => '修改'
- ,'formpost' => 'PUT'
- ,'url' => '/teacher/index/update/' . $id
- );
-
- // 模板赋值
- $this->view->assign('list', $list);
- // 渲染
- return $this->view->fetch('create');
- }
-
-
- // 更新教师信息
- public function update($id)
- {
- // 获取表单数据
- $list = request()->only([
- 'xingming'
- ,'sex'
- ,'quanpin'
- ,'shoupin'
- ,'shengri'
- ,'phone'
- ,'zhiwu_id'
- ,'zhicheng_id'
- ,'xueli_id'
- ,'biye'
- ,'worktime'
- ,'zhuanye'
- ,'danwei_id'
- ,'tuixiu'
- ], 'PUT');
- $list['id'] = $id;
-
- // 验证表单数据
- $validate = new \app\teacher\validate\Teacher;
- $result = $validate->scene('edit')->check($list);
- $msg = $validate->getError();
- if(!$result){
- return json(['msg' => $msg, 'val' => 0]);;
- }
- $tc = new TC();
- $temp = TC::withTrashed()->where('phone', $list['phone'])->find();
- if($temp)
- {
- if($temp->id != $id*1)
- {
- return json(['msg' => '手机号已经存在', 'val' => 0]);
- }
- }
-
- $list['quanpin'] = trim(strtolower(str_replace(' ', '', $list['quanpin'])));
- $list['shoupin'] = trim(strtolower($list['shoupin']));
-
- // 更新数据
- $teacher = new TC();
- $teacherlist = $teacher->find($id);
-
- $teacherlist->xingming = $list['xingming'];
- $teacherlist->sex = $list['sex'];
- $teacherlist->quanpin = $list['quanpin'];
- $teacherlist->shoupin = $list['shoupin'];
- $teacherlist->shengri = $list['shengri'];
- $teacherlist->phone = $list['phone'];
- $teacherlist->zhiwu_id = $list['zhiwu_id'];
- $teacherlist->zhicheng_id = $list['zhicheng_id'];
- $teacherlist->xueli_id = $list['xueli_id'];
- $teacherlist->biye = $list['biye'];
- $teacherlist->worktime = $list['worktime'];
- $teacherlist->zhuanye = $list['zhuanye'];
- $teacherlist->danwei_id = $list['danwei_id'];
- $teacherlist->tuixiu = $list['tuixiu'];
- $data = $teacherlist->save();
-
- // 根据更新结果设置返回提示信息
- $data>=0 ? $data = ['msg' => '更新成功', 'val' => 1]
- : $data = ['msg' => '数据处理错误', 'val' => 0];
-
- // 返回信息
- return json($data);
- }
-
-
- // 删除教师
- public function delete($id)
- {
- // 整理数据
- $id = request()->delete('id');
- $id = explode(',', $id);
-
- $data = TC::destroy($id);
-
- // 根据更新结果设置返回提示信息
- $data ? $data = ['msg' => '删除成功', 'val' => 1]
- : $data = ['msg' => '数据处理错误', 'val' => 0];
-
- // 返回信息
- return json($data);
- }
-
-
- // 恢复删除
- public function reDel($id)
- {
- $user = TC::onlyTrashed()->find($id);
- $data = $user->restore();
-
- // 根据更新结果设置返回提示信息
- $data ? $data = ['msg' => '恢复成功', 'val' => 1]
- : $data = ['msg' => '数据处理错误', 'val' => 0];
-
- // 返回信息
- return json($data);
- }
-
-
- // 设置教师状态
- public function setStatus()
- {
- // 获取id变量
- $id = request()->post('id');
- $value = request()->post('value');
-
- // 获取教师信息
- $data = TC::where('id', $id)->update(['status' => $value]);
-
- // 根据更新结果设置返回提示信息
- $data ? $data = ['msg' => '状态设置成功', 'val' => 1]
- : $data = ['msg' => '数据处理错误', 'val' => 0];
-
- // 返回信息
- return json($data);
- }
-
-
- // 批量添加
- public function createAll()
- {
- // 设置页面标题
- $list['set'] = array(
- 'webtitle' => '批量上传教师信息'
- ,'butname' => '批传'
- ,'formpost' => 'POST'
- ,'url' => 'saveall'
- );
-
- // 模板赋值
- $this->view->assign('list', $list);
- // 渲染
- return $this->view->fetch();
- }
-
-
- // 批量保存
- public function saveAll()
- {
- // 获取表单数据
- $list = request()->only([
- 'school_id'
- ,'url'
- ], 'POST');
-
- // 实例化操作表格类
- $teacherinfo = \app\facade\File::readXls(public_path() . 'uploads/' . $list['url']);
-
- // 判断表格是否正确
- if("教师基本情况表" != $teacherinfo[0][0] || '姓名*' != $teacherinfo[2][1] || '性别*' != $teacherinfo[2][2])
- {
- $this->error('请使用模板上传', '/login/err');
- return json($data);
- }
-
- $teacher = new TC;
- $data = $teacher->createAll($teacherinfo, $list['school_id']);
- $data ? $data = ['msg' => '数据上传成功', 'val' => 1]
- : ['msg' => '数据上传失败', 'val' => 0];
-
- return json($data);
- }
-
-
- // 根据教师姓名、首拼、全拼搜索教师信息
- public function srcTeacher()
- {
- // 获取参数
- $src = $this->request
- ->only([
- 'str' => ''
- ,'danwei_id' => ''
- ,'field' => 'id'
- ,'order' => 'desc'
- ,'teacher_id' => ''
- ], 'POST');
-
- $teacher = new TC();
- $data = $teacher->strSrcTeachers($src);
-
- $data = reSetObject($data, $src);
-
- return json($data);
- }
-
-
- // 下载表格模板
- public function downloadXls()
- {
- $fengefu = DIRECTORY_SEPARATOR;
- $url = public_path() . 'uploads' . $fengefu . 'teacher' . $fengefu . 'TeacherInfo.xlsx';
- return download($url, '教师名单模板.xlsx');
- }
-
-
- // 查询教师荣誉
- public function srcRy()
- {
- // 获取参数
- $src = $this->request
- ->only([
- 'page' => '1'
- ,'limit' => '10'
- ,'field' => 'update_time'
- ,'order' => 'desc'
- ,'teacher_id' => ''
- ], 'POST');
-
- // 查询数据
- $rongyu = new \app\rongyu\model\JsRongyuInfo;
- $data = $rongyu->srcTeacherRongyu($src['teacher_id'])
- ->visible([
- 'id'
- ,'title'
- ,'ryTuce' => [
- 'title'
- ,'fzSchool'
- ]
- ,'jiangxiang_id'
- ,'hjshijian'
- ,'update_time'
- ]);
- $data = reSetObject($data, $src);
- return json($data);
- }
-
-
- // 查询教师课题
- public function srcKt()
- {
- // 获取参数
- $src = $this->request
- ->only([
- 'page' => '1'
- ,'limit' => '10'
- ,'field' => 'update_time'
- ,'order' => 'desc'
- ,'teacher_id' => ''
- ], 'POST');
-
- // 查询数据
- $keti = new \app\keti\model\KetiInfo;
- $data = $keti->srcTeacherKeti($src['teacher_id']);
- $data = reSetObject($data, $src);
-
- return json($data);
- }
-
-
- // 重置密码
- public function resetpassword($id)
- {
- // 生成密码
- $md5 = new \WhiteHat101\Crypt\APR1_MD5;
- $password = $md5->hash('123456');
-
- // 查询用户信息
- $data = TC::where('id', $id)->update(['password' => $password]);
- // 根据更新结果设置返回提示信息
- $data ? $data = ['msg' => '密码已经重置为:
123456', 'val' => 1]
- : $data = ['msg' => '数据处理错误', 'val' => 0];
-
- // 返回信息
- return json($data);
- }
-
-}
diff --git a/app/teacher/model/Teacher.php b/app/teacher/model/Teacher.php
deleted file mode 100644
index e0ab718b..00000000
--- a/app/teacher/model/Teacher.php
+++ /dev/null
@@ -1,365 +0,0 @@
- array()
- ,'danwei_id' => array()
- ,'xueli_id' => array()
- ,'zhicheng_id' => array()
- ,'tuixiu' => 0
- ,'searchval' => ''
- ];
- // 用新值替换初始值
- $src = array_cover($srcfrom, $src);
- $src['zhiwu_id'] = strToArray($src['zhiwu_id']);
- $src['danwei_id'] = strToArray($src['danwei_id']);
- $src['xueli_id'] = strToArray($src['xueli_id']);
- $src['zhicheng_id'] = strToArray($src['zhicheng_id']);
-
- $data = $this->when(count($src['danwei_id']) > 0, function($query) use($src){
- $query->where('danwei_id', 'in', $src['danwei_id']);
- })
- ->when(count($src['zhiwu_id']) > 0, function($query) use($src){
- $query->where('zhiwu_id', 'in', $src['zhiwu_id']);
- })
- ->when(count($src['xueli_id']) > 0, function($query) use($src){
- $query->where('xueli_id', 'in', $src['xueli_id']);
- })
- ->when(count($src['zhicheng_id']) > 0, function($query) use($src){
- $query->where('zhicheng_id', 'in', $src['zhicheng_id']);
- })
- ->where('tuixiu', $src['tuixiu'])
- ->when(strlen($src['searchval']) > 0, function($query) use($src){
- $query->where('xingming|shoupin', 'like', '%' . $src['searchval'] . '%');
- })
- ->with(
- [
- 'jsDanwei' => function($query){
- $query->field('id, jiancheng');
- },
- 'jsZhiwu' => function($query){
- $query->field('id, title');
- },
- 'jsZhicheng' => function($query){
- $query->field('id, title');
- },
- 'jsXueli' => function($query){
- $query->field('id, title');
- },
- 'jsSubject' => function($query){
- $query->field('id, title');
- },
- ]
- )
- ->append(['age', 'gongling'])
- ->select();
-
-
-
- return $data;
- }
-
-
- //搜索单位获奖荣誉
- public function searchDel($srcfrom)
- {
- $src = [
- 'danwei_id' => array()
- ,'zhiwu_id' => array()
- ,'xueli_id' => array()
- ,'searchval' => ''
- ];
- // 用新值替换初始值
- $src = array_cover($srcfrom, $src);
- $src['zhiwu_id'] = strToArray($src['zhiwu_id']);
- $src['danwei_id'] = strToArray($src['danwei_id']);
- $src['xueli_id'] = strToArray($src['xueli_id']);
-
- $data = $this::onlyTrashed()
- ->when(count($src['danwei_id']) > 0, function($query) use($src){
- $query->where('danwei_id','in',$src['danwei_id']);
- })
- ->when(count($src['zhiwu_id']) > 0, function($query) use($src){
- $query->where('zhiwu_id','in',$src['zhiwu_id']);
- })
- ->when(count($src['xueli_id']) > 0, function($query) use($src){
- $query->where('xueli_id','in',$src['xueli_id']);
- })
- ->when(strlen($src['searchval']) > 0, function($query) use($src){
- $query->where('xingming|quanpin|shoupin', 'like', '%' . $src['searchval'] . '%');
- })
- ->with(
- [
- 'jsDanwei'=>function($query){
- $query->field('id, jiancheng');
- },
- 'jsZhiwu'=>function($query){
- $query->field('id, title');
- },
- 'jsZhicheng'=>function($query){
- $query->field('id, title');
- },
- 'jsXueli'=>function($query){
- $query->field('id, title');
- },
- 'jsSubject'=>function($query){
- $query->field('id, title');
- },
- ]
- )
- ->append(['age', 'gongling'])
- ->select();
-
- return $data;
- }
-
-
- // 表格导入教师信息
- public function createAll($arr, $School_id)
- {
- $pinyin = new \Overtrue\Pinyin\Pinyin;
-
- // 整理表格数据
- array_splice($arr, 0, 4); # 删除标题行
- $arr = array_filter($arr,function($item){ #过滤空值
- return $item[1] !== null && $item[2] !== null && $item[3] !== null ;
- });
-
- // 组合需要保存的数据
- $i = 0;
- $teacherlist = array();
- foreach ($arr as $key => $value) {
- $phone = str_replace(' ', '', $value[4]);
- $temp = $this->phoneSrc($phone);
- if($temp)
- {
- if($temp->delete_time > 0)
- {
- $temp->restore();
- }
- $teacherlist[$i]['id'] = $temp->id;
- }
- $teacherlist[$i]['xingming'] = $value[1];
- $teacherlist[$i]['sex'] = $this->cutStr($value[2]);
- $teacherlist[$i]['shengri'] = $value[3];
- $teacherlist[$i]['phone'] = $phone;
- $teacherlist[$i]['worktime'] = $value[5];
- $teacherlist[$i]['zhiwu_id'] = $this->cutStr($value[6]);
- $teacherlist[$i]['zhicheng_id'] = $this->cutStr($value[7]);
- $teacherlist[$i]['danwei_id'] = $School_id;
- $teacherlist[$i]['biye'] = $value[9];
- $teacherlist[$i]['subject_id'] = $this->cutStr($value[8]);
- $teacherlist[$i]['zhuanye'] = $value[9];
- $teacherlist[$i]['xueli_id'] = $this->cutStr($value[11]);
- $quanpin = $pinyin->sentence($value[1]);
- $jianpin = $pinyin->abbr($value[1]);
- $teacherlist[$i]['quanpin'] = trim(strtolower(str_replace(' ', '', $quanpin)));
- $teacherlist[$i]['shoupin'] = trim(strtolower($jianpin));
- $i++;
- }
-
- $teacherlist = array_filter($teacherlist, function($q){ ## 过滤姓名、身份证号或班级为空的数据
- return $q['sex'] != null && $q['zhiwu_id'] != null && $q['zhicheng_id'] != null && $q['subject_id'] != null && $q['xueli_id'] != null;
- });
-
- // 保存或更新信息
- $data = $this->saveAll($teacherlist);
-
- return true;
- }
-
-
- // 根据姓名、首拼查询教师
- public function strSrcTeachers($srcfrom)
- {
- $src = [
- 'str' => ''
- ,'danwei_id' => ''
- ];
- $src = array_cover($srcfrom, $src);
- // 如果有数据则查询教师信息
- $list = self::field('id, xingming, danwei_id, shengri, sex')
- ->whereOr('xingming', 'like', '%' . $src['str'] . '%')
- ->whereOr('shoupin', 'like', $src['str'] . '%')
- ->when(strlen($src['danwei_id']) > 0, function ($query) use($src) {
- $query->where('danwei_id', $src['danwei_id']);
- })
- ->with(
- [
- 'jsDanwei' => function($query){
- $query->field('id, jiancheng');
- },
- ]
- )
- ->append(['age'])
- ->select();
-
- return $list;
- }
-
-
- // 查询教师荣誉
- public function srcRongyu($teacher_id)
- {
- // 实例化荣誉数据模型
- $ry = new \app\rongyu\model\JsRongyuInfo;
-
- // 查询荣誉信息
- $data = $ry->where('status', 1)
- ->where('id', 'in', function($query) use($teacher_id){
- $query->name('jsRongyuCanyu')
- ->where('teacher_id', $teacher_id)
- ->field('rongyu_id');
- })
- ->with(
- [
- 'jxCategory'=>function($query){
- $query->field('id, title');
- },
- 'ryTuce'=>function($query){
- $query->field('id, title, fzschool_id, category_id')
- ->with([
- 'fzSchool'=>function($query){
- $query->field('id, jiancheng, jibie_id')
- ->with(['dwJibie' => function($q){
- $q->field('id, title');
- }]);
- },
- 'lxCategory'=>function($query){
- $query->field('id, title');
- },
-
- ]);
- },
- 'hjJsry'=>function($query){
- $query->field('rongyu_id, teacher_id')
- ->with(['teacher'=>function($query){
- $query->field('id, xingming');
- }]);
- },
- ])
- ->field('id, rongyuce_id, jiangxiang_id, hjshijian, title')
- ->order('hjshijian')
- ->select();
- return $data;
- }
-
-
- // 职务关联模型
- public function jsZhiwu()
- {
- return $this->belongsTo('\app\system\model\Category', 'zhiwu_id', 'id');
- }
-
-
- // 职称关联模型
- public function jsZhicheng()
- {
- return $this->belongsTo('\app\system\model\Category', 'zhicheng_id', 'id');
- }
-
-
- // 学历关联模型
- public function jsXueli()
- {
- return $this->belongsTo('\app\system\model\Category', 'xueli_id', 'id');
- }
-
-
- // 单位关联模型
- public function jsDanwei()
- {
- return $this->belongsTo('\app\system\model\School', 'danwei_id', 'id');
- }
-
-
- // 学科关联模型
- public function jsSubject()
- {
- return $this->belongsTo('\app\teach\model\Subject', 'subject_id', 'id');
- }
-
-
- // 生日修改器
- public function setShengriAttr($value)
- {
- return strtotime($value);
- }
-
-
- // 生日获取器
- public function getShengriAttr($value)
- {
- return date('Y-m-d', $value);
- }
-
-
- // 参加工作时间获取器
- public function getWorktimeAttr($value)
- {
- return date('Y-m-d', $value);
- }
-
-
- // 参加工作时间修改器
- public function setWorktimeAttr($value)
- {
- return strtotime($value);
- }
-
-
- // 性别获取器
- public function getSexAttr($value)
- {
- $sex = array('0' => '女', '1' => '男');
- $str = '';
- if(isset($sex[$value]))
- {
- $str = $sex[$value];
- }else{
- $str = '未知';
- }
- return $str;
- }
-
-
- // 退休获取器
- public function getTuixiuAttr($value)
- {
- $sex = array('0' => '否', '1' => '是');
- $str = '';
- if(isset($sex[$value]))
- {
- $str = $sex[$value];
- }else{
- $str = '未知';
- }
- return $str;
- }
-
-
- // 年龄获取器
- public function getAgeAttr()
- {
- return \app\facade\Tools::fBirth($this->getdata('shengri'), 2);
- }
-
-
- // 工龄获取器
- public function getGonglingAttr()
- {
- return \app\facade\Tools::fBirth($this->getdata('worktime'), 2);
- }
-
-
-
-}
diff --git a/app/teacher/route/teacher.php b/app/teacher/route/teacher.php
deleted file mode 100644
index d25a2d3b..00000000
--- a/app/teacher/route/teacher.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
-// +----------------------------------------------------------------------
-use think\facade\Route;
-
-// 教师管理
-Route::group('index', function () {
- Route::rule('index','Index/index','get'); # 信息列表
- Route::rule('data','Index/ajaxdata','post'); # 获取数据
- Route::rule('create','Index/create','get'); # 添加信息
- Route::rule('save','Index/save','post'); # 保存信息
- Route::rule('read/','Index/read','get'); # 读取信息
- Route::rule('edit/','Index/edit','get'); # 修改信息
- Route::rule('update/','Index/update','put'); # 更新信息
- Route::rule('delete/','Index/delete','delete'); # 删除信息
- Route::rule('status','Index/setStatus','post'); # 删除信息
- Route::rule('createall','Index/createAll','get'); # 批量导入
- Route::rule('saveall','Index/saveAll','post'); # 批量保存
- Route::rule('upload','Index/upload','post'); # 批量导入
- Route::rule('srcteacher','Index/srcTeacher','post'); # 查询教师
- Route::rule('downloadxls','Index/downloadXls','get'); # 下载模板
- Route::rule('srcry','Index/srcRy','post'); # 查询荣誉
- Route::rule('srckt','Index/srcKt','post'); # 查询课题
- Route::rule('dellist','Index/delList','get'); # 信息列表
- Route::rule('datadel','Index/ajaxDataDel','post'); # 获取数据
- Route::rule('redel/','Index/reDel','delete'); # 获取学生成绩
- Route::rule('resetpassword/','Index/resetpassword','post'); # 重置教师密码
-
- Route::rule('tongbu','Index/tongbu','get'); # 添加信息
-});
diff --git a/app/teacher/validate/Teacher.php b/app/teacher/validate/Teacher.php
deleted file mode 100644
index db438bd7..00000000
--- a/app/teacher/validate/Teacher.php
+++ /dev/null
@@ -1,76 +0,0 @@
- ['规则1','规则2'...]
- *
- * @var array
- */
- protected $rule = [
- 'id|ID' => 'require|number',
- 'xingming|姓名' => 'require|chs|length:2,8',
- 'quanpin|姓名全拼' => 'require|alpha|length:1,30',
- 'shoupin|姓名首拼' => 'require|alpha|length:1,5',
- 'sex|性别' => 'require|number|max:2',
- 'danwei_id|单位' => 'require|number',
- 'shengri|出生日期' => 'date',
- 'phone|手机号' => 'require|mobile',
- 'zhiwu_id|职务' => 'number',
- 'zhicheng_id|职称' => 'number',
- 'xueli_id|学历' => 'number',
- 'biye|毕业院校' => 'length:1,50',
- 'zhuanye|专业' => 'length:1,20',
- 'worktime|参加工作时间' => 'date',
- 'tuixiu|退休' => 'require|number|max:2',
- ];
-
- /**
- * 定义错误信息
- * 格式:'字段名.规则名' => '错误信息'
- *
- * @var array
- */
- protected $message = [];
-
- protected $scene = [
- 'create' => [
- 'xingming'
- ,'quanpin'
- ,'shoupin'
- ,'sex'
- ,'danwei_id'
- ,'shengri'
- ,'phone'
- ,'zhiwu_id'
- ,'zhicheng_id'
- ,'xueli_id'
- ,'biye'
- ,'zhuanye'
- ,'worktime'
- ,'tuixiu'
- ],
- 'edit' => [
- 'id'
- ,'xingming'
- ,'quanpin'
- ,'shoupin'
- ,'sex'
- ,'danwei_id'
- ,'shengri'
- ,'phone'
- ,'zhiwu_id'
- ,'zhicheng_id'
- ,'xueli_id'
- ,'biye'
- ,'zhuanye'
- ,'worktime'
- ,'tuixiu'
- ],
- ];
-}
diff --git a/app/teacher/view/index/create.html b/app/teacher/view/index/create.html
deleted file mode 100644
index cdc64e62..00000000
--- a/app/teacher/view/index/create.html
+++ /dev/null
@@ -1,233 +0,0 @@
-{extend name=".././view/create.html" /}
-{block name="jscss"}
- {load href="__STATIC__/Convert_Pinyin.js" /}
-{/block}
-{block name="form"}
-
-{/block}
-
-{block name="myjs"}
-
-{/block}
-
diff --git a/app/teacher/view/index/create_all.html b/app/teacher/view/index/create_all.html
deleted file mode 100644
index 984c74ee..00000000
--- a/app/teacher/view/index/create_all.html
+++ /dev/null
@@ -1,80 +0,0 @@
-{extend name=".././view/create.html" /}
-
-{block name="form"}
-
-{/block}
-
-{block name="myjs"}
-
-{/block}
-
diff --git a/app/teacher/view/index/del_list.html b/app/teacher/view/index/del_list.html
deleted file mode 100644
index 50851636..00000000
--- a/app/teacher/view/index/del_list.html
+++ /dev/null
@@ -1,138 +0,0 @@
-{extend name=".././view/list.html" /}
-{block name="jsset"}
-{/block}
-{block name="nav"}
-
- 师生名单
- 教师管理
- 异动教师
-
-{/block}
-{block name="search"}
-
-
-
-
-
-{/block}
-{block name="table"}
-
-{/block}
-{block name="myjs"}
-
-
-
-
-
-
-{/block}
diff --git a/app/teacher/view/index/index.html b/app/teacher/view/index/index.html
deleted file mode 100644
index ecfafb66..00000000
--- a/app/teacher/view/index/index.html
+++ /dev/null
@@ -1,201 +0,0 @@
-{extend name=".././view/list.html" /}
-{block name="jsset"}
-{/block}
-{block name="nav"}
-
- 师生名单
- 教师管理
- 教师列表
-
-{/block}
-{block name="search"}
-
-
-
-
-
-
-
-
-
-{/block}
-{block name="table"}
-
-{/block}
-{block name="myjs"}
-
-
-
-
-
-
-{/block}
diff --git a/app/teacher/view/index/read.html b/app/teacher/view/index/read.html
deleted file mode 100644
index ff305967..00000000
--- a/app/teacher/view/index/read.html
+++ /dev/null
@@ -1,293 +0,0 @@
-
-
-
-
- {php}echo session('webtitle'){/php}
-
-
-
- {load href="__XADMIN__/css/font.css" /}
- {load href="__XADMIN__/css/xadmin.css" /}
- {load href="__XADMIN__/js/jquery.min.js" /}
- {load href="__XADMIN__/lib/layui/layui.js" /}
- {load href="__XADMIN__/js/xadmin.js" /}
- {load href="__XADMIN__/js/cookie.js" /}
- {load href="__XADMIN__/js/md5.min.js" /}
- {$list.webtitle}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/config/shangma.php b/config/shangma.php
index cc2a7e98..18fa7243 100755
--- a/config/shangma.php
+++ b/config/shangma.php
@@ -10,7 +10,7 @@ return [
# 系统版本
'webtitle' => '码蚁成绩管理',
# 系统版本
- 'version' => 'v1.3.8',
+ 'version' => 'v1.3.9 Beta',
# 是否开启维护跳转
'weihu' => Env::get('shangma.weihu', false),
# 开始时间
diff --git a/public/static/x-admin2.2/js/backUp.js b/public/static/x-admin2.2/js/backUp.js
index df9714cc..abdc9e46 100644
--- a/public/static/x-admin2.2/js/backUp.js
+++ b/public/static/x-admin2.2/js/backUp.js
@@ -28,7 +28,6 @@ layui.define(['table'], function(exports) {
'/system/backup/export',
'',
function(data) {
- console.log(data);
if (data.code == 1) {
layer.msg("开始备份,请不要关闭或刷新本页面!");
layui.backUp.beifen(data.data.tab);