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');