public function index(){
if(request()->isPost()){
$limit=input("?post.limit")?input("limit"):10;
$page=input("?post.page")?input("page"):1;
$list = Db::name('user')
->paginate(['limit'=>$limit,'page'=>$page])
->each(function ($item) {
$item['create_time'] = date('Y-m-d H:i:s', $item['create_time']);
if ($item['uid']) {
$item['user'] = Db::name('user')
->where('id', $item['uid']) ->find();
}
return $item;
})->toArray();
return json(['code'=>0,'msg'=>'成功','count'=>$list['total'],'data'=>$list['data']]);
}
return view();
}