layui数据表格

<table id="LAY-user-manage" lay-filter="LAY-user-manage"></table>
//用户管理
        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);

    }

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值