Skip to content
关注公众号,获取新课通知

会员等级列表


控制器 app/controller/admin/UserLevel.php

php
public function index()
{
    $param = $this->request->param();
    $limit = intval(getValByKey('limit',$param,10));
    $page = getValByKey('page',$param,1);
    $totalCount = $this->M->count();
    $list = $this->M->page($page,$limit)->order([
        'order'=>'desc',
        'id'=>'desc'
    ])->select();
    return showSuccess([
        'list'=>$list,
        'totalCount'=>$totalCount
    ]);
}

验证器 app/validate/admin/UserLevel.php

protected $rule = [
    'page' => 'require|integer|>:0',
];
protected $scene = [
    ...
    'index'=>['page'],
    ...
];

路由 router/admin.php

Route::get('user_level/:page','admin.UserLevel/index');