From 687e086c31fa0bec9af89dbfd9eb6e1d7dc1561d Mon Sep 17 00:00:00 2001 From: cxdbz Date: Fri, 12 Apr 2019 22:02:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E5=88=97=E8=A1=A8ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/view/index/welcome.html | 9 - application/kaoshi/controller/Index.php | 8 +- application/keti/controller/Index.php | 8 +- application/keti/controller/KetiInfo.php | 8 +- application/renshi/controller/Index.php | 72 ++- application/renshi/controller/Student.php | 8 +- application/renshi/model/Teacher.php | 32 +- application/renshi/view/index/create.html | 279 +++++------ application/renshi/view/index/index.html | 443 +++++++----------- application/rongyu/controller/DwRongyu.php | 8 +- application/rongyu/controller/JsRongyu.php | 8 +- .../rongyu/controller/JsRongyuInfo.php | 8 +- application/teach/model/Xueqi.php | 2 +- 13 files changed, 335 insertions(+), 558 deletions(-) diff --git a/application/index/view/index/welcome.html b/application/index/view/index/welcome.html index 7a9d4599..c844836c 100644 --- a/application/index/view/index/welcome.html +++ b/application/index/view/index/welcome.html @@ -102,15 +102,6 @@ 运行环境 {$list.server.SERVER_SOFTWARE} - - PHP版本 - 5.6.27 - - PHP运行方式 - cgi-fcgi - - MYSQL版本 - 5.5.53 ThinkPHP {$Think.version} diff --git a/application/kaoshi/controller/Index.php b/application/kaoshi/controller/Index.php index ba610865..bc10a675 100644 --- a/application/kaoshi/controller/Index.php +++ b/application/kaoshi/controller/Index.php @@ -15,13 +15,11 @@ class Index extends Base public function index() { - // 设置数据总数 - $list['count'] = KS::count(); - // 设置页面标题 - $list['title'] = '考试列表'; + // 设置要给模板赋值的信息 + $list['webtitle'] = '考试列表'; // 模板赋值 - $this->assign('list', $list); + $this->assign('list',$list); // 渲染模板 return $this->fetch(); diff --git a/application/keti/controller/Index.php b/application/keti/controller/Index.php index 8c4096b4..f3b262d1 100644 --- a/application/keti/controller/Index.php +++ b/application/keti/controller/Index.php @@ -17,13 +17,11 @@ class Index extends Base */ public function index() { - // 设置数据总数 - $list['count'] = keti::count(); - // 设置页面标题 - $list['title'] = '课题列表'; + // 设置要给模板赋值的信息 + $list['webtitle'] = '课题册列表'; // 模板赋值 - $this->assign('list', $list); + $this->assign('list',$list); // 渲染模板 return $this->fetch(); diff --git a/application/keti/controller/KetiInfo.php b/application/keti/controller/KetiInfo.php index 42b6abed..3eb27955 100644 --- a/application/keti/controller/KetiInfo.php +++ b/application/keti/controller/KetiInfo.php @@ -17,13 +17,11 @@ class KetiInfo extends Base */ public function index() { - // 设置数据总数 - $list['count'] = ktinfo::count(); - // 设置页面标题 - $list['title'] = '课题信息列表'; + // 设置要给模板赋值的信息 + $list['webtitle'] = '课题信息列表'; // 模板赋值 - $this->assign('list', $list); + $this->assign('list',$list); // 渲染模板 return $this->fetch(); diff --git a/application/renshi/controller/Index.php b/application/renshi/controller/Index.php index 17982251..ae2e99f2 100644 --- a/application/renshi/controller/Index.php +++ b/application/renshi/controller/Index.php @@ -17,13 +17,11 @@ class Index extends Base public function index() { - // 设置数据总数 - $list['count'] = Teacher::count(); - // 设置页面标题 - $list['title'] = '教师列表'; + // 设置要给模板赋值的信息 + $list['webtitle'] = '教师列表'; // 模板赋值 - $this->assign('list', $list); + $this->assign('list',$list); // 渲染模板 return $this->fetch(); @@ -37,58 +35,42 @@ class Index extends Base */ public function ajaxData() { - // 获取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 = [ - 'zhiwu'=>$getdt['zhiwu'], - 'zhicheng'=>$getdt['zhicheng'], - 'danwei'=>$getdt['danwei'], - 'xueli'=>$getdt['xueli'], - 'subject'=>$getdt['subject'], - 'search'=>$getdt['search']['value'], - 'order'=>$order, - 'order_field'=>$order_field - ]; + // 获取参数 + $src = $this->request + ->only([ + 'page'=>'1', + 'limit'=>'10', + 'field'=>'update_time', + 'order'=>'asc', + 'zhiwu'=>array(), + 'danwei'=>array(), + 'xueli'=>array(), + 'subject'=>array(), + 'searchval'=>'' + ],'POST'); // 实例化 $teacher = new Teacher; - // 获取荣誉总数 - $cnt = $teacher->select()->count(); - - // 查询数据 - $data = $teacher->search($search); - $datacnt = $data->count(); - + // 查询要显示的数据 + $data = $teacher->search($src); + // 获取符合条件记录总数 + $cnt = $data->count(); // 获取当前页数据 + $limit_start = $src['page'] * $src['limit'] - $src['limit']; + $limit_length = $src['limit']-1; $data = $data->slice($limit_start,$limit_length); - - + // 重组返回内容 $data = [ - 'draw'=> $getdt["draw"] , // ajax请求次数,作为标识符 - 'recordsTotal'=>$cnt, // 获取到的结果数(每页显示数量) - 'recordsFiltered'=>$datacnt, // 符合条件的总数据量 + 'code'=> 0 , // ajax请求次数,作为标识符 + 'msg'=>"", // 获取到的结果数(每页显示数量) + 'count'=>$cnt, // 符合条件的总数据量 'data'=>$data, //获取到的数据结果 ]; + return json($data); } diff --git a/application/renshi/controller/Student.php b/application/renshi/controller/Student.php index 938372fb..6241dc7f 100644 --- a/application/renshi/controller/Student.php +++ b/application/renshi/controller/Student.php @@ -17,13 +17,11 @@ class Student extends Base public function index() { - // 设置数据总数 - $list['count'] = STU::count(); - // 设置页面标题 - $list['title'] = '学生列表'; + // 设置要给模板赋值的信息 + $list['webtitle'] = '学生列表'; // 模板赋值 - $this->assign('list', $list); + $this->assign('list',$list); // 渲染模板 return $this->fetch(); diff --git a/application/renshi/model/Teacher.php b/application/renshi/model/Teacher.php index 2a17d7ca..ce0588d4 100644 --- a/application/renshi/model/Teacher.php +++ b/application/renshi/model/Teacher.php @@ -10,37 +10,31 @@ class Teacher extends Base //搜索单位获奖荣誉 - public function search($search) + public function search($src) { // 获取参数 - $zhiwu = $search['zhiwu']; - $zhicheng = $search['zhicheng']; - $danwei = $search['danwei']; - $xueli = $search['xueli']; - $subject = $search['subject']; - $order_field = $search['order_field']; - $order = $search['order']; - $search = $search['search']; + $zhiwu = $src['zhiwu']; + $danwei = $src['danwei']; + $xueli = $src['xueli']; + $subject = $src['subject']; + $searchval = $src['searchval']; - $data = $this->order([$order_field =>$order]) - ->when(strlen($danwei)>0,function($query) use($danwei){ + $data = $this->order([$src['field'] =>$src['order']]) + ->when(count($danwei)>0,function($query) use($danwei){ $query->where('danwei','in',$danwei); }) - ->when(strlen($zhiwu)>0,function($query) use($zhiwu){ + ->when(count($zhiwu)>0,function($query) use($zhiwu){ $query->where('zhiwu','in',$zhiwu); }) - ->when(strlen($zhicheng)>0,function($query) use($zhicheng){ - $query->where('zhicheng','in',$zhicheng); - }) - ->when(strlen($xueli)>0,function($query) use($xueli){ + ->when(count($xueli)>0,function($query) use($xueli){ $query->where('xueli','in',$xueli); }) - ->when(strlen($subject)>0,function($query) use($subject){ + ->when(count($subject)>0,function($query) use($subject){ $query->where('subject','in',$subject); }) - ->when(strlen($search)>0,function($query) use($search){ - $query->where('xingming|quanpin|shoupin','like','%'.$search.'%'); + ->when(strlen($searchval)>0,function($query) use($searchval){ + $query->where('xingming|quanpin|shoupin','like','%'.$searchval.'%'); }) ->with( [ diff --git a/application/renshi/view/index/create.html b/application/renshi/view/index/create.html index 6f22ca70..c309e56f 100644 --- a/application/renshi/view/index/create.html +++ b/application/renshi/view/index/create.html @@ -1,178 +1,111 @@ {extend name="common@create" /} -{block name="formaa"} -
-
- -
- -
-
-
- -
- - -
-
-
- -
-
- - -
-
- - -
-
- - -
-
-
-
- -
- -
-
-
- -
- - {php} $school = schlist('校级','区级');{/php} - - -
-
-
- -
- - {php}$list = getCategory(107);{/php} - - -
-
-
- -
- - {php}$list = getCategory(106);{/php} - - -
-
-
- -
- - {php}$list = getCategory(105);{/php} - - -
-
- -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
-
-
+{block name="form"} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ {php} $category = getCategory(101);{/php} + +
+
+
+ +
+ {php} $category = getCategory(102);{/php} + +
+
+
+ +
+ {php} $category = getCategory(103);{/php} + +
+
+
+ +
+ +
+
+
+ +
+
{/block} -{block name="yanzheng"} - -{/block} \ No newline at end of file diff --git a/application/renshi/view/index/index.html b/application/renshi/view/index/index.html index ebb1e81f..487c43c1 100644 --- a/application/renshi/view/index/index.html +++ b/application/renshi/view/index/index.html @@ -1,288 +1,179 @@ -{extend name="common@list" /} -{block name="topnav"} - -{/block} -{block name="bouttons"} -
- - - - - 批量删除 - - - - - 批量上传 - - - - 添加教师 - - - - 共有数据:{$list.count} 条 - -
-
-
筛选教师信息
-
-
- {php} - $school = schlist('校级','区级'); - {/php} - -
-
- {foreach $school as $key=>$vo } - - {/foreach} -
- -
-
- {php}$category = getCategory(107);{/php} - -
-
- {foreach $category as $key=>$vo } - - {/foreach} -
- -
-
- {php}$category = getCategory(106);{/php} - -
-
- {foreach $category as $key=>$vo } - - {/foreach} -
- -
-
- {php}$category = getCategory(105);{/php} - -
-
- {foreach $category as $key=>$vo } - - {/foreach} -
- -
-
- {php} - $subject = new \app\teach\model\Subject; - $subject = $subject->where('status',1)->field('id,jiancheng')->select(); - {/php} - -
-
- {foreach $subject as $key=>$vo } - - {/foreach} -
- -
+{extend name="common@list" /} +{block name="jsset"} + +{/block} +{block name="nav"} + + 师生名单 + 教师管理 + 教师列表 + +{/block} +{block name="search"} + {/block} -{block name="tables"} - - - - - - - - - - - - - - - - - - -
姓名性别周岁学历毕业院校工龄专业工作单位状态操作
- - +{block name="table"} +
{/block} {block name="myjs"} - + + + + {/block} \ No newline at end of file diff --git a/application/rongyu/controller/DwRongyu.php b/application/rongyu/controller/DwRongyu.php index cc3b5855..ebf9b001 100644 --- a/application/rongyu/controller/DwRongyu.php +++ b/application/rongyu/controller/DwRongyu.php @@ -16,13 +16,11 @@ class DwRongyu extends Base */ public function index() { - // 设置数据总数 - $list['count'] = dwry::count(); - // 设置页面标题 - $list['title'] = '单位荣誉'; + // 设置要给模板赋值的信息 + $list['webtitle'] = '单位荣誉列表'; // 模板赋值 - $this->assign('list', $list); + $this->assign('list',$list); // 渲染模板 return $this->fetch(); diff --git a/application/rongyu/controller/JsRongyu.php b/application/rongyu/controller/JsRongyu.php index 3a566cea..85d4ed16 100644 --- a/application/rongyu/controller/JsRongyu.php +++ b/application/rongyu/controller/JsRongyu.php @@ -18,13 +18,11 @@ class JsRongyu extends Base */ public function index() { - // 设置数据总数 - $list['count'] = jsry::count(); - // 设置页面标题 - $list['title'] = '教师荣誉册'; + // 设置要给模板赋值的信息 + $list['webtitle'] = '教师荣誉册列表'; // 模板赋值 - $this->assign('list', $list); + $this->assign('list',$list); // 渲染模板 return $this->fetch(); diff --git a/application/rongyu/controller/JsRongyuInfo.php b/application/rongyu/controller/JsRongyuInfo.php index b007c240..dadf0acd 100644 --- a/application/rongyu/controller/JsRongyuInfo.php +++ b/application/rongyu/controller/JsRongyuInfo.php @@ -22,13 +22,11 @@ class JsRongyuInfo extends Base */ public function index() { - // 设置数据总数 - $list['count'] = ryinfo::count(); - // 设置页面标题 - $list['title'] = '教师荣誉信息'; + // 设置要给模板赋值的信息 + $list['webtitle'] = '教师列表'; // 模板赋值 - $this->assign('list', $list); + $this->assign('list',$list); // 渲染模板 return $this->fetch(); diff --git a/application/teach/model/Xueqi.php b/application/teach/model/Xueqi.php index 476e3d4d..0f123510 100644 --- a/application/teach/model/Xueqi.php +++ b/application/teach/model/Xueqi.php @@ -47,7 +47,7 @@ class Xueqi extends Base $data = $this ->order([$src['field'] =>$src['order']]) ->when(strlen($searchval)>0,function($query) use($searchval){ - $query->where('title|jiancheng','like','%'.$searchval.'%'); + $query->where('title|xuenian','like','%'.$searchval.'%'); }) ->with( [