From 5d8b4c13f8718c50be11b07df733cb96aa830aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Mon, 15 Apr 2019 13:03:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=94=99=E8=AF=AF=E3=80=81=E6=95=99=E5=B8=88=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=8E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/auth_group/index.html | 4 +- application/admin/view/auth_rule/index.html | 4 +- application/admin/view/index/index.html | 4 +- application/renshi/controller/Index.php | 11 +- application/renshi/model/Teacher.php | 4 - application/renshi/view/index/create.html | 194 ++++++--- application/renshi/view/index/create_all.html | 372 +++++++++--------- .../renshi/view/index/create_all1.html | 195 +++++++++ application/renshi/view/index/index.html | 70 ++-- application/system/controller/School.php | 1 + application/system/controller/SystemBase.php | 2 +- application/system/view/category/create.html | 4 +- application/system/view/category/index.html | 8 +- application/system/view/school/index.html | 4 +- .../system_base/{index.html => edit.html} | 0 application/teach/controller/Banji.php | 57 +++ application/teach/view/banji/index.html | 8 +- application/teach/view/subject/index.html | 4 +- application/teach/view/xueqi/index.html | 8 +- database/seeds/Rule.php | 1 + 20 files changed, 652 insertions(+), 303 deletions(-) create mode 100644 application/renshi/view/index/create_all1.html rename application/system/view/system_base/{index.html => edit.html} (100%) diff --git a/application/admin/view/auth_group/index.html b/application/admin/view/auth_group/index.html index 94af09e9..0d948d77 100644 --- a/application/admin/view/auth_group/index.html +++ b/application/admin/view/auth_group/index.html @@ -31,10 +31,10 @@ diff --git a/application/admin/view/auth_rule/index.html b/application/admin/view/auth_rule/index.html index d10c6449..a29e3cf3 100644 --- a/application/admin/view/auth_rule/index.html +++ b/application/admin/view/auth_rule/index.html @@ -31,10 +31,10 @@ diff --git a/application/admin/view/index/index.html b/application/admin/view/index/index.html index 773e75c4..e01f44ce 100644 --- a/application/admin/view/index/index.html +++ b/application/admin/view/index/index.html @@ -31,10 +31,10 @@ diff --git a/application/renshi/controller/Index.php b/application/renshi/controller/Index.php index bfd1855a..b72766db 100644 --- a/application/renshi/controller/Index.php +++ b/application/renshi/controller/Index.php @@ -45,7 +45,6 @@ class Index extends Base 'zhiwu'=>array(), 'danwei'=>array(), 'xueli'=>array(), - 'subject'=>array(), 'searchval'=>'' ],'POST'); @@ -80,13 +79,17 @@ class Index extends Base public function create() { // 设置页面标题 - $list['title'] = '添加教师'; + $list['set'] = array( + 'webtitle'=>'添加老师', + 'butname'=>'添加', + 'formpost'=>'POST', + 'url'=>'/teacher', + ); // 模板赋值 $this->assign('list',$list); - // 渲染 - return $this->fetch(); + return $this->fetch('create'); } diff --git a/application/renshi/model/Teacher.php b/application/renshi/model/Teacher.php index ce0588d4..77b3b3e3 100644 --- a/application/renshi/model/Teacher.php +++ b/application/renshi/model/Teacher.php @@ -16,7 +16,6 @@ class Teacher extends Base $zhiwu = $src['zhiwu']; $danwei = $src['danwei']; $xueli = $src['xueli']; - $subject = $src['subject']; $searchval = $src['searchval']; @@ -30,9 +29,6 @@ class Teacher extends Base ->when(count($xueli)>0,function($query) use($xueli){ $query->where('xueli','in',$xueli); }) - ->when(count($subject)>0,function($query) use($subject){ - $query->where('subject','in',$subject); - }) ->when(strlen($searchval)>0,function($query) use($searchval){ $query->where('xingming|quanpin|shoupin','like','%'.$searchval.'%'); }) diff --git a/application/renshi/view/index/create.html b/application/renshi/view/index/create.html index c309e56f..8d82c5c9 100644 --- a/application/renshi/view/index/create.html +++ b/application/renshi/view/index/create.html @@ -1,63 +1,75 @@ {extend name="common@create" /} {block name="form"} + +
+ +
-
-
- +
- {php} $category = getCategory(101);{/php} + {php} $schoollist = schlist('校级','校级');{/php} + {volist name="schoollist" id="vo"} + + {/volist} +
+
+
+ +
+ {php} $category = getCategory(107);{/php} {volist name="category" id="vo"} - + + {/volist} +
+
+
+ +
+ {php} $category = getCategory(105);{/php} + {volist name="category" id="vo"} + {/volist}
@@ -40,10 +58,13 @@ @@ -81,39 +102,29 @@ layui.use(['table','laypage','form','cjgl'], function(){ {field: 'xingming', title: '姓名',sort: true}, {field: 'sex', title: '性别',sort: true}, {field: "shengri",title: '周岁',sort: true,templet:function(d){ - var str=''; - if(d.age) - { - str = d.age; - } - return str; + return d.age; }}, {field: 'xueli', title: '学历',sort: true,templet:function(d){ var str=''; - if(d.dw_jibie) + if(d.js_xueli) { - str = d.dw_jibie.title; + str = d.js_xueli.title; } return str; }} , - {field: 'biye', title: '毕业院校',sort: true,templet:function(d){ - var str=''; - if(d.dw_xueduan) - { - str = d.dw_xueduan.title; - } - return str; - }}, + {field: 'biye', title: '毕业院校',sort: true}, {field: 'worktime', title: '工龄', sort: true,templet:function(d){ - var str=''; - if(d.gongling) - { - str = d.gongling; - } - return str; + return d.gongling; }}, {field: 'zhuanye', title: '专业', sort: true}, - {field: 'danwei', title: '单位', sort: true}, + {field: 'danwei', title: '单位', sort: true,templet:function(d){ + var str=''; + if(d.js_danwei) + { + str = d.js_danwei.jiancheng; + } + return str; + }}, {field: 'status', title: '状态',templet:'#status', sort: true}, {field: 'id', title: '操作',toolbar: '#barDemo',minWidth:140} ]], @@ -156,6 +167,9 @@ layui.use(['table','laypage','form','cjgl'], function(){ case 'add': cjgl.add('添加教师','/teacher/create','','',true); break; + case 'upload': + cjgl.add('导入教师','/teacher/create','','',true); + break; }; }); diff --git a/application/system/controller/School.php b/application/system/controller/School.php index 264c58bc..17c5fdd7 100644 --- a/application/system/controller/School.php +++ b/application/system/controller/School.php @@ -136,6 +136,7 @@ class School extends Base 'url'=>'/school/'.$id, ); + // 模板赋值 $this->assign('list',$list); // 渲染 diff --git a/application/system/controller/SystemBase.php b/application/system/controller/SystemBase.php index 277b99bd..6cc81991 100644 --- a/application/system/controller/SystemBase.php +++ b/application/system/controller/SystemBase.php @@ -11,7 +11,7 @@ use app\system\model\SystemBase as sysbasemod; class SystemBase extends Base { // 系统设置 - public function index() + public function edit() { // 获取用户信息 $list['data'] = sysbasemod::field('id,webtitle,keywords,description,thinks,danwei') diff --git a/application/system/view/category/create.html b/application/system/view/category/create.html index e5e6714e..dd54e9bc 100644 --- a/application/system/view/category/create.html +++ b/application/system/view/category/create.html @@ -16,7 +16,7 @@
{php} $category = getCategory(0);{/php} + autocomplete="off" class="layui-input" value="{$list.data.paixu|default=''}" placeholder="数字1-999">
diff --git a/application/system/view/category/index.html b/application/system/view/category/index.html index e517dd5e..03d09c9c 100644 --- a/application/system/view/category/index.html +++ b/application/system/view/category/index.html @@ -41,10 +41,10 @@ @@ -132,7 +132,7 @@ layui.use(['table','laypage','form','cjgl'], function(){ cjgl.delAll(checkStatus,'/category','mytable'); break; case 'add': - cjgl.add('添加类别','/category/create','450','300'); + cjgl.add('添加类别','/category/create','450','300',''); break; }; }); @@ -152,7 +152,7 @@ layui.use(['table','laypage','form','cjgl'], function(){ cjgl.del(obj,"/category"); break; case 'edit':// 编辑 - cjgl.add('编辑类别','/category/'+obj.data.id+'/edit','650','500'); + cjgl.add('编辑类别','/category/'+obj.data.id+'/edit','650','300',''); break; case 'status':// 状态 cjgl.status(obj,"{:url('setstatus')}"); diff --git a/application/system/view/school/index.html b/application/system/view/school/index.html index 9f1cc3ee..c1de0f8b 100644 --- a/application/system/view/school/index.html +++ b/application/system/view/school/index.html @@ -40,10 +40,10 @@ diff --git a/application/system/view/system_base/index.html b/application/system/view/system_base/edit.html similarity index 100% rename from application/system/view/system_base/index.html rename to application/system/view/system_base/edit.html diff --git a/application/teach/controller/Banji.php b/application/teach/controller/Banji.php index bdfb3f71..7f6314f6 100644 --- a/application/teach/controller/Banji.php +++ b/application/teach/controller/Banji.php @@ -27,6 +27,7 @@ class Banji extends Base // 获取班级信息列表 public function ajaxData() { +<<<<<<< HEAD // 获取参数 $src = $this->request ->only([ @@ -53,6 +54,62 @@ class Banji extends Base $data = $data->slice($limit_start,$limit_length); // 重组返回内容 +======= + + // 获取DT的传值 + $getdt = request()->param(); + + //得到排序的方式 + $order = $getdt['order'][0]['dir']; + //得到排序字段的下标 + $order_column = $getdt['order'][0]['column']; + //根据排序字段的下标得到排序字段 + $order_field = $getdt['columns'][$order_column]['name']; + if($order_field=='') + { + $order_field = $getdt['columns'][$order_column]['data']; + } + //得到limit参数 + $limit_start = $getdt['start']; + $limit_length = $getdt['length']; + //得到搜索的关键词 + $search = $getdt['search']['value']; + + + // 获取记录集总数 + $cnt = BJ::count(); + //查询数据 + $data =BJ::field('id,school,ruxuenian,paixu,status') + ->order([$order_field=>$order]) + ->limit($limit_start,$limit_length) + ->all(); + + + // 如果需要查询 + if($search){ + $data = BJ::field('id,school,ruxuenian,paixu,status') + ->order([$order_field=>$order]) + ->limit($limit_start,$limit_length) + // ->whereOr('title','like','%'.$search.'%') + ->whereOr('school','in',function($query) use($search) + { + $query->name('school') + ->where('title','like','%'.$search.'%') + ->field('id'); + }) + ->where('paixu','<',26) + ->whereOr('ruxuenian',$search) + ->all(); + } + + $datacnt = $data->count(); + //追加班级名称 + $data = $data->append(['title','stusum']); + + + + +>>>>>>> 0d5bedf7255ec98dc5b204a5a7b1de71ce51cb08 $data = [ 'code'=> 0 , // ajax请求次数,作为标识符 'msg'=>"", // 获取到的结果数(每页显示数量) diff --git a/application/teach/view/banji/index.html b/application/teach/view/banji/index.html index 785771c8..145ff348 100644 --- a/application/teach/view/banji/index.html +++ b/application/teach/view/banji/index.html @@ -52,10 +52,10 @@ @@ -151,7 +151,7 @@ layui.use(['table','laypage','form','cjgl'], function(){ cjgl.delAll(checkStatus,'/banji','mytable'); break; case 'add': - cjgl.add('添加班级','/banji/create','400','400'); + cjgl.add('添加班级','/banji/create','400','300'); break; }; }); @@ -177,7 +177,7 @@ layui.use(['table','laypage','form','cjgl'], function(){ cjgl.del(obj,"/banji"); break; case 'edit':// 编辑 - cjgl.add('编辑班级','/banji/'+obj.data.id+'/edit','400','400'); + cjgl.add('编辑班级','/banji/'+obj.data.id+'/edit','400','300'); break; case 'status':// 状态 cjgl.status(obj,"{:url('setstatus')}"); diff --git a/application/teach/view/subject/index.html b/application/teach/view/subject/index.html index 22daf3e9..f6cafa4a 100644 --- a/application/teach/view/subject/index.html +++ b/application/teach/view/subject/index.html @@ -31,10 +31,10 @@ diff --git a/application/teach/view/xueqi/index.html b/application/teach/view/xueqi/index.html index 2974f14c..28818c80 100644 --- a/application/teach/view/xueqi/index.html +++ b/application/teach/view/xueqi/index.html @@ -31,10 +31,10 @@ @@ -122,7 +122,7 @@ layui.use(['table','laypage','form','cjgl'], function(){ cjgl.delAll(checkStatus,'/xueqi','mytable'); break; case 'add': - cjgl.add('添加学期','/xueqi/create','650','350'); + cjgl.add('添加学期','/xueqi/create','','',true); break; }; }); @@ -142,7 +142,7 @@ layui.use(['table','laypage','form','cjgl'], function(){ cjgl.del(obj,"/xueqi"); break; case 'edit':// 编辑 - cjgl.add('编辑学期','/xueqi/'+obj.data.id+'/edit','650','350'); + cjgl.add('编辑学期','/xueqi/'+obj.data.id+'/edit','','',true); break; case 'status':// 状态 cjgl.status(obj,"{:url('setstatus')}"); diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php index 30b03cd1..3967a44f 100644 --- a/database/seeds/Rule.php +++ b/database/seeds/Rule.php @@ -117,6 +117,7 @@ class Rule extends Seeder ['title'=>'查看','name'=>'renshi/Index/read','paixu'=>4,'pid'=>402,], ['title'=>'状态','name'=>'renshi/Index/setStatus','paixu'=>5,'pid'=>402], ['title'=>'查询教师','name'=>'renshi/Index/srcTeacher','paixu'=>6,'pid'=>402], + ['title'=>'批量上传','name'=>'renshi/Index/createAll','paixu'=>7,'pid'=>401], // 教务管理