mirror of https://gitee.com/karson/fastadmin.git
selectpage只保留id和username字段
parent
5766f4ea5b
commit
08355f6d31
|
|
@ -107,6 +107,32 @@ class Admin extends Backend
|
||||||
return $this->view->fetch();
|
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;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue