部门增加排序该功能:越大越靠前',升级时需要更新sql语句:ALTER TABLE oa_department
ADD COLUMN sort
int(11) NOT NULL DEFAULT 0 COMMENT '排序:越大越靠前' AFTER remark
;
This commit is contained in:
parent
404b5aa939
commit
986a61a0b1
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 '创建时间',
|
||||
|
@ -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 {
|
||||
|
@ -21,8 +21,12 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">排序<font>*</font></td>
|
||||
<td>
|
||||
<input type="text" name="sort" lay-verify="required|number" value="0" autocomplete="off" placeholder="请输入排序" lay-reqText="请输入排序" class="layui-input">
|
||||
</td>
|
||||
<td class="layui-td-gray-2">部门联系电话</td>
|
||||
<td colspan="3">
|
||||
<td>
|
||||
<input type="text" name="phone" placeholder="请输入部门联系电话,可空" autocomplete="off" class="layui-input">
|
||||
</td>
|
||||
</tr>
|
||||
@ -43,6 +47,10 @@
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray">排序<font>*</font></td>
|
||||
<td>
|
||||
<input type="text" name="sort" lay-verify="required|number" value="{$detail.sort}" autocomplete="off" placeholder="请输入排序" lay-reqText="请输入排序" class="layui-input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray-2">部门负责人</td>
|
||||
@ -55,7 +63,7 @@
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray-2">部门联系电话</td>
|
||||
<td>
|
||||
<td colspan="3">
|
||||
<input type="text" name="phone" value="{$detail.phone}" placeholder="请输入部门联系电话,可空" autocomplete="off" class="layui-input">
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -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) {
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user