Commit c082d4a3 authored by hujun's avatar hujun

权限列表分页

parent f7461ff3
......@@ -9,7 +9,6 @@
namespace app\index\controller;
use app\index\extend\Basic;
use app\index\untils\AuthUntils;
use app\model\AuthGroup;
class Auth extends Basic
{
......@@ -55,7 +54,10 @@ class Auth extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$auth_group = New AuthGroup();
$data = $auth_group->getList($pageNo, $pageSize, '','*');
$where = 'status <> 0';
$data['list'] = $auth_group->getList($pageNo, $pageSize, '','*', $where);
$data['total'] = $auth_group->getTotal($where);
return $this->response(200, '', $data);
}
......
......@@ -17,5 +17,9 @@
</tbody>
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right pageinfo" id="pagediv">
</div>
</div>
</div>
\ No newline at end of file
......@@ -2,8 +2,8 @@
// 权限模型
namespace app\model;
use think\Model;
class AuthGroup extends Model
class AuthGroup extends BaseModel
{
const TYPE_ADMIN = 1; // 管理员用户组类型标识
const MEMBER = 'agents';
......
......@@ -26,7 +26,7 @@ define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagina
success: function (data) {
var temp = document.getElementById ('auth_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#auth_list").html (doTtmpl (data.data));
$ ("#auth_list").html (doTtmpl (data.data.list));
/*分页代码*/
$ ("#pagediv").pagination ({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment