selectpage只保留id和username字段

pull/41/head
devlike 2018-02-08 11:08:42 +08:00
parent 5766f4ea5b
commit 08355f6d31
1 changed files with 26 additions and 0 deletions

View File

@ -107,6 +107,32 @@ class Admin extends Backend
return $this->view->fetch();
}
/**
* 管理员列表
*/
public function selectpage()
{
if ($this->request->isAjax())
{
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->where($where)
->field(['id', 'username as name'])
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "list" => $list);
return json($result);
}
return null;
}
/**
* 添加
*/