//用户管理
table.render({
elem: '#LAY-user-manage',
url: '{:U("auth/get_layui_list")}' //模拟接口
,
cols: [
[
{ type: 'checkbox', fixed: 'left' },
{ field: 'auth_id', width: 100, title: 'ID', sort: true },
{ field: 'auth_name', title: '权限名称', minWidth: 100 },
{ field: 'auth_pid', title: '父id', minWidth: 100 },
{ field: 'auth_c', title: '控制器', width: 100 },
{ field: 'auth_a', title: '方法' },
{ field: 'auth_path', title: '全路径', sort: true },
{ field: 'auth_level', width: 80, title: '等级'},
{ field: 'auth_show', title: '导航显示', templet: function(d){
if(d.auth_show == '1'){
return '显示';
}else if(d.auth_show == '2'){
return '不显示';
}else{
return '';
}
} },
{ field: 'auth_jichu', title: '基础权限', sort: true },
{ title: '操作', width: 150, align: 'center', fixed: 'right', toolbar: '#table-useradmin-webuser' }
]
],
page: true,
limit: 30,
height: 'full-220',
text: '对不起,加载出现异常!'
});
public function get_layui_list()
{
$_auth = M('Auth');
$page = I('get.page');
$limit = I('get.limit');
$count = $_auth->count();
$info = $_auth ->page($page, $limit)->order('auth_path')->select();
if ($info) {
$code = '0';
$msg = "获取成功!";
} else {
$code = '1';
$msg = '获取失败!';
}
setLayuiData($code, $msg, $count, $info);
}