From 588b0ce6c90e5dd40ca016416c87f4946a206188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Wed, 8 May 2019 14:34:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=A1=E4=BB=B6=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/AuthGroup.php | 2 +- application/admin/controller/AuthRule.php | 2 +- application/admin/controller/Index.php | 2 +- application/admin/model/Admin.php | 2 +- application/admin/model/AuthGroup.php | 2 +- application/admin/model/AuthRule.php | 2 +- application/admin/view/auth_group/index.html | 120 +++------- application/admin/view/auth_rule/index.html | 154 +++++------- application/admin/view/index/index.html | 126 ++++------ application/chengji/controller/Index.php | 2 +- application/chengji/model/Chengji.php | 4 - .../chengji/view/index/index - 副本.html | 214 ----------------- application/chengji/view/index/index.html | 224 +++++------------- application/common.php | 3 +- application/common/view/list.html | 85 ++++--- application/kaoshi/model/Kaohao.php | 5 +- application/kaoshi/view/index/index.html | 137 ++++------- application/renshi/controller/Index.php | 2 +- application/renshi/controller/Student.php | 2 +- application/renshi/model/Student.php | 2 +- application/renshi/model/Teacher.php | 2 +- application/renshi/view/index/index.html | 178 ++++++-------- application/renshi/view/student/index.html | 194 ++++++--------- application/system/controller/Category.php | 2 +- application/system/controller/School.php | 2 +- application/system/model/Category.php | 2 +- application/system/model/School.php | 2 +- application/system/view/category/index.html | 151 ++++-------- application/system/view/school/index.html | 142 ++++------- application/teach/controller/Banji.php | 2 +- application/teach/controller/Subject.php | 2 +- application/teach/controller/Xueqi.php | 2 +- application/teach/model/Banji.php | 2 +- application/teach/model/Subject.php | 2 +- application/teach/model/Xueqi.php | 2 +- application/teach/view/banji/index.html | 222 ++++++----------- application/teach/view/subject/index.html | 135 ++++------- application/teach/view/xueqi/index.html | 156 +++++------- 38 files changed, 722 insertions(+), 1570 deletions(-) delete mode 100644 application/chengji/view/index/index - 副本.html diff --git a/application/admin/controller/AuthGroup.php b/application/admin/controller/AuthGroup.php index eb9b3798..e29584f2 100644 --- a/application/admin/controller/AuthGroup.php +++ b/application/admin/controller/AuthGroup.php @@ -33,7 +33,7 @@ class AuthGroup extends Base 'page'=>'1', 'limit'=>'10', 'field'=>'id', - 'order'=>'asc', + 'type'=>'asc', 'searchval'=>'' ],'POST'); diff --git a/application/admin/controller/AuthRule.php b/application/admin/controller/AuthRule.php index 921c9799..2856444f 100644 --- a/application/admin/controller/AuthRule.php +++ b/application/admin/controller/AuthRule.php @@ -32,7 +32,7 @@ class AuthRule extends Base 'page'=>'1' ,'limit'=>'10' ,'field'=>'id' - ,'order'=>'asc' + ,'type'=>'asc' ,'searchval'=>'' ],'POST'); diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index 80b2f5a2..bca95233 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -34,7 +34,7 @@ class Index extends Base 'page'=>'1' ,'limit'=>'10' ,'field'=>'id' - ,'order'=>'desc' + ,'type'=>'desc' ,'searchval'=>'' ],'POST'); diff --git a/application/admin/model/Admin.php b/application/admin/model/Admin.php index 91d162e7..9afdf521 100644 --- a/application/admin/model/Admin.php +++ b/application/admin/model/Admin.php @@ -15,7 +15,7 @@ class Admin extends Base // 查询数据 $data = $this - ->order([$src['field'] =>$src['order']]) + ->order([$src['field'] =>$src['type']]) ->where('id','>',2) ->when(strlen($searchval)>0,function($query) use($searchval){ $query->where('xingming|username','like','%'.$searchval.'%'); diff --git a/application/admin/model/AuthGroup.php b/application/admin/model/AuthGroup.php index 473569ec..06696f77 100644 --- a/application/admin/model/AuthGroup.php +++ b/application/admin/model/AuthGroup.php @@ -15,7 +15,7 @@ class AuthGroup extends Base // 查询数据 $data = $this - ->order([$src['field'] =>$src['order']]) + ->order([$src['field'] =>$src['type']]) ->when(strlen($searchval)>0,function($query) use($searchval){ $query->where('title','like','%'.$searchval.'%'); }) diff --git a/application/admin/model/AuthRule.php b/application/admin/model/AuthRule.php index 005505a9..10edb218 100644 --- a/application/admin/model/AuthRule.php +++ b/application/admin/model/AuthRule.php @@ -30,7 +30,7 @@ class AuthRule extends Base // 查询数据 $data = $this - ->order([$src['field'] =>$src['order']]) + ->order([$src['field'] =>$src['type']]) ->when(strlen($searchval)>0,function($query) use($searchval){ $query->where('title|name','like','%'.$searchval.'%'); }) diff --git a/application/admin/view/auth_group/index.html b/application/admin/view/auth_group/index.html index 204e2044..7c8e42ec 100644 --- a/application/admin/view/auth_group/index.html +++ b/application/admin/view/auth_group/index.html @@ -11,7 +11,6 @@ {/block} {block name="search"} - - {/block} {block name="table"}
@@ -44,66 +42,22 @@ {/block} \ No newline at end of file diff --git a/application/admin/view/auth_rule/index.html b/application/admin/view/auth_rule/index.html index 912258b6..ec919e03 100644 --- a/application/admin/view/auth_rule/index.html +++ b/application/admin/view/auth_rule/index.html @@ -11,16 +11,14 @@ {/block} {block name="search"} - + +
+ +
+ {/block} {block name="table"}
@@ -44,74 +42,32 @@ {/block} \ No newline at end of file diff --git a/application/admin/view/index/index.html b/application/admin/view/index/index.html index 46df9015..bb2747a6 100644 --- a/application/admin/view/index/index.html +++ b/application/admin/view/index/index.html @@ -11,16 +11,14 @@ {/block} {block name="search"} - +
+ +
+ +
+
{/block} {block name="table"}
@@ -44,26 +42,8 @@ {/block} \ No newline at end of file diff --git a/application/chengji/controller/Index.php b/application/chengji/controller/Index.php index fc40e3aa..54784222 100644 --- a/application/chengji/controller/Index.php +++ b/application/chengji/controller/Index.php @@ -257,7 +257,7 @@ class Index extends Base 'page'=>'1', 'limit'=>'10', 'field'=>'banji', - 'order'=>'desc', + 'type'=>'desc', 'kaoshi'=>'1', 'school'=>array(), 'nianji'=>array(), diff --git a/application/chengji/model/Chengji.php b/application/chengji/model/Chengji.php index a7da9074..0b503ea5 100644 --- a/application/chengji/model/Chengji.php +++ b/application/chengji/model/Chengji.php @@ -26,13 +26,9 @@ class Chengji extends Base $data = $this ->order([$src['field'] =>$src['order']]) - // ->when(count($school)>0,function($query) use($school){ - // $query->where('school','in',$school); - // }) ->when(strlen($searchval)>0,function($query) use($searchval){ $query->where('xingming','like','%'.$searchval.'%')->field('id'); }) - // ->append(['age']) ->select(); return $data; diff --git a/application/chengji/view/index/index - 副本.html b/application/chengji/view/index/index - 副本.html deleted file mode 100644 index 7f0820f1..00000000 --- a/application/chengji/view/index/index - 副本.html +++ /dev/null @@ -1,214 +0,0 @@ - -{extend name="common@list" /} -{block name="jsset"} - -{/block} -{block name="nav"} - - 系统管理 - 单位管理 - 单位列表 - -{/block} -{block name="search"} - - - -{/block} -{block name="table"} -
-
-{/block} -{block name="myjs"} - - - - - - -{/block} \ No newline at end of file diff --git a/application/chengji/view/index/index.html b/application/chengji/view/index/index.html index 95b43cc2..363e5ad1 100644 --- a/application/chengji/view/index/index.html +++ b/application/chengji/view/index/index.html @@ -25,7 +25,7 @@
{php} $schoollist = schlist('校级','校级');{/php} {volist name="schoollist" id="vo"} - + {/volist}
@@ -34,7 +34,7 @@
{php} $njlist = nianjiList();{/php} {foreach $njlist as $key=>$vo} - + {/foreach}
@@ -78,178 +78,64 @@ {/block} \ No newline at end of file diff --git a/application/common.php b/application/common.php index f42e4364..117028dd 100644 --- a/application/common.php +++ b/application/common.php @@ -266,7 +266,8 @@ function upload($list,$file,$isSave=false) * $field 排序字段 * $sort 排序方式 SORT_DESC 降序;SORT_ASC 升序 * */ -function arraySequence($array, $field = 'age', $sort = 'SORT_DESC') { +function arraySequence($array, $field = 'id', $sort = 'SORT_DESC') { + $arr = array(); foreach ($array as $key => $value) { foreach ($value as $k => $val) { diff --git a/application/common/view/list.html b/application/common/view/list.html index 2375be83..22b84db4 100644 --- a/application/common/view/list.html +++ b/application/common/view/list.html @@ -32,12 +32,10 @@

筛选

-
+ {block name="search"}{/block}
- +
@@ -55,49 +53,74 @@ layui.config({ base: "__STATIC__/xadmin/js/" //假设这是你存放拓展模块的根目录 }); + // 声明表格,和表格参数变量 - var userTable,options; + var userTable,options,formval; // 设置表格初始变量 options = { elem: '#tabledemo', toolbar: '#toolbarDemo', - url:"{:url('ajaxdata1')}", - cols:[[ //表头 - {type:'checkbox', fixed: 'left'}, - {field: 'school', title: '学校',sort: true}, - {field: 'nianji', title: '年级 ', minWidth:100,sort: true}, - {field: "banji",title: '班级',sort: true}, - {field: "student",title: '学生姓名',sort: true}, - {field: 'status', title: '状态',templet:'#status', sort: true}, - {field: 'id', title: '操作',toolbar: '#barDemo',minWidth:140} - ]] + url:"{:url('ajaxdata')}", + method:"POST", //数据接口 + page: true, //开启分页 + loading:true, + autoSort:false, + id:'mytable', + defaultToolbar:'', }; {block name="myjs"}{/block} diff --git a/application/kaoshi/model/Kaohao.php b/application/kaoshi/model/Kaohao.php index d42987bc..cb4f6099 100644 --- a/application/kaoshi/model/Kaohao.php +++ b/application/kaoshi/model/Kaohao.php @@ -123,9 +123,12 @@ class Kaohao extends Base $data[$key][$xk[$val->subject_id]] = $val->defen; } } + + $src['type'] == 'asc' ? $sort='SORT_ASC' : $sort='SORT_DESC'; + // 按条件排序 if(count($data)>0){ - $data = arraySequence($data,$src['field']); //排序 + $data = arraySequence($data,$src['field'],$sort); //排序 } return $data; } diff --git a/application/kaoshi/view/index/index.html b/application/kaoshi/view/index/index.html index 69e234ae..16944a42 100644 --- a/application/kaoshi/view/index/index.html +++ b/application/kaoshi/view/index/index.html @@ -10,17 +10,15 @@ {/block} {block name="search"} - +
+ +
+ +
+
{/block} {block name="table"}
@@ -49,26 +47,9 @@ {/block} \ No newline at end of file diff --git a/application/renshi/controller/Index.php b/application/renshi/controller/Index.php index bcc05ce1..e50034cf 100644 --- a/application/renshi/controller/Index.php +++ b/application/renshi/controller/Index.php @@ -38,7 +38,7 @@ class Index extends Base 'page'=>'1', 'limit'=>'10', 'field'=>'update_time', - 'order'=>'desc', + 'type'=>'desc', 'zhiwu'=>array(), 'danwei'=>array(), 'xueli'=>array(), diff --git a/application/renshi/controller/Student.php b/application/renshi/controller/Student.php index 0f86256c..dfcdaf47 100644 --- a/application/renshi/controller/Student.php +++ b/application/renshi/controller/Student.php @@ -35,7 +35,7 @@ class Student extends Base 'page'=>'1', 'limit'=>'10', 'field'=>'update_time', - 'order'=>'desc', + 'type'=>'desc', 'school'=>array(), 'ruxuenian'=>array(), 'paixu'=>array(), diff --git a/application/renshi/model/Student.php b/application/renshi/model/Student.php index 4da8f197..ea2d5284 100644 --- a/application/renshi/model/Student.php +++ b/application/renshi/model/Student.php @@ -58,7 +58,7 @@ class Student extends Base $data = $this - ->order([$src['field'] =>$src['order']]) + ->order([$src['field'] =>$src['type']]) ->when(count($school)>0,function($query) use($school){ $query->where('school','in',$school); }) diff --git a/application/renshi/model/Teacher.php b/application/renshi/model/Teacher.php index 77b3b3e3..87fad972 100644 --- a/application/renshi/model/Teacher.php +++ b/application/renshi/model/Teacher.php @@ -19,7 +19,7 @@ class Teacher extends Base $searchval = $src['searchval']; - $data = $this->order([$src['field'] =>$src['order']]) + $data = $this->order([$src['field'] =>$src['type']]) ->when(count($danwei)>0,function($query) use($danwei){ $query->where('danwei','in',$danwei); }) diff --git a/application/renshi/view/index/index.html b/application/renshi/view/index/index.html index 211d8a7a..88b32016 100644 --- a/application/renshi/view/index/index.html +++ b/application/renshi/view/index/index.html @@ -11,43 +11,41 @@ {/block} {block name="search"} -