编写用户列表
This commit is contained in:
1 parent
0cb0ee8a2e
commit
296c5d2965
6 files changed
+32
-42
No files matched your search
@@ -16,9 +16,7 @@ class Index extends Base
|
||||
$admin = new Admin();
|
||||
|
||||
// 获取管理员信息
|
||||
$list = $admin
|
||||
->where('id','>',1)
|
||||
->all();
|
||||
$list['title'] = '管理员列表';
|
||||
|
||||
// 模板赋值
|
||||
$this->assign('list',$list);
|
||||
@@ -28,6 +26,28 @@ class Index extends Base
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 获取数据管理员数据
|
||||
public function ajaxData()
|
||||
{
|
||||
//实例化管理员数据模型类
|
||||
$admin = new Admin();
|
||||
|
||||
$data = $admin
|
||||
->field('id,username')
|
||||
->all();
|
||||
// $data =[
|
||||
// "data"=> [
|
||||
// [
|
||||
// "Tiger Nixon",
|
||||
// "System Architect",
|
||||
// ],]];
|
||||
// $data = $data->toArray();
|
||||
$data = ['data'=>$data];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示创建资源表单页.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user