From 986a61a0b1126f5344b30bb812bbab32c2fba5c4 Mon Sep 17 00:00:00 2001 From: hdm Date: Thu, 20 Oct 2022 08:51:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=A2=9E=E5=8A=A0=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E8=AF=A5=E5=8A=9F=E8=83=BD=EF=BC=9A=E8=B6=8A=E5=A4=A7?= =?UTF-8?q?=E8=B6=8A=E9=9D=A0=E5=89=8D',=E5=8D=87=E7=BA=A7=E6=97=B6?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=9B=B4=E6=96=B0sql=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=EF=BC=9AALTER=20TABLE=20`oa=5Fdepartment`=20ADD=20COLUMN=20`so?= =?UTF-8?q?rt`=20int(11)=20NOT=20NULL=20DEFAULT=200=20COMMENT=20'=E6=8E=92?= =?UTF-8?q?=E5=BA=8F:=E8=B6=8A=E5=A4=A7=E8=B6=8A=E9=9D=A0=E5=89=8D'=20AFTE?= =?UTF-8?q?R=20`remark`;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 2 +- app/install/data/gouguoa.sql | 1 + app/user/controller/Department.php | 2 +- app/user/view/department/add.html | 12 ++++++++++-- app/user/view/department/index.html | 1 + public/index.php | 2 +- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/common.php b/app/common.php index 8ed0106..6f0e5bb 100644 --- a/app/common.php +++ b/app/common.php @@ -205,7 +205,7 @@ function check_auth($rule, $uid) //读取部门列表 function get_department() { - $department = Db::name('Department')->where(['status' => 1])->select()->toArray(); + $department = Db::name('Department')->order('sort desc,id asc')->where(['status' => 1])->select()->toArray(); return $department; } diff --git a/app/install/data/gouguoa.sql b/app/install/data/gouguoa.sql index 5325ac4..14ca144 100644 --- a/app/install/data/gouguoa.sql +++ b/app/install/data/gouguoa.sql @@ -460,6 +460,7 @@ CREATE TABLE `oa_department` ( `pid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上级部门id', `leader_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '部门负责人ID', `phone` varchar(60) NOT NULL DEFAULT '' COMMENT '部门联系电话', + `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序:越大越靠前', `remark` varchar(1000) NULL DEFAULT '' COMMENT '备注', `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', diff --git a/app/user/controller/Department.php b/app/user/controller/Department.php index 5d836b9..1af3410 100644 --- a/app/user/controller/Department.php +++ b/app/user/controller/Department.php @@ -24,7 +24,7 @@ class Department extends BaseController ->field('d.*,a.name as leader') ->alias('d') ->join('Admin a', 'a.id = d.leader_id', 'LEFT') - ->order('d.id asc') + ->order('d.sort desc,d.id asc') ->select(); return to_assign(0, '', $list); } else { diff --git a/app/user/view/department/add.html b/app/user/view/department/add.html index e8d46cf..6b5b981 100644 --- a/app/user/view/department/add.html +++ b/app/user/view/department/add.html @@ -21,8 +21,12 @@ + 排序* + + + 部门联系电话 - + @@ -43,6 +47,10 @@ {/volist} + 排序* + + + 部门负责人 @@ -55,7 +63,7 @@ 部门联系电话 - + diff --git a/app/user/view/department/index.html b/app/user/view/department/index.html index 2ca6a16..31cfe09 100644 --- a/app/user/view/department/index.html +++ b/app/user/view/department/index.html @@ -33,6 +33,7 @@ { field: 'id', width: 100, title: 'ID号', align: 'center' } , { field: 'pid', title: '上级部门ID',width: 120, align: 'center'} , { field: 'title', title: '部门名称'} + , { field: 'sort', title: '排序',width: 80, align: 'center'} , { field: 'leader', title: '部门负责人',width: 120, align: 'center'} , { field: 'phone', title: '部门电话',width: 160,} , { width:180, title: '操作', align: 'center', templet: function (d) { diff --git a/public/index.php b/public/index.php index 5285751..b59e6e8 100644 --- a/public/index.php +++ b/public/index.php @@ -15,7 +15,7 @@ if (empty(file_exists(__DIR__ . '/../vendor/autoload.php'))) { require __DIR__ . '/../vendor/autoload.php'; // 定义当前版本号 -define('CMS_VERSION','4.10.07'); +define('CMS_VERSION','4.10.20'); // 定义Layui版本号 define('LAYUI_VERSION','2.7.6');