From e0e5b7a0bb4d48d24a612d88abc15889e48f1363 Mon Sep 17 00:00:00 2001 From: zhao Date: Thu, 13 Feb 2020 13:18:17 +0800 Subject: [PATCH] sex status --- app/admin/controller/User.php | 8 ++++---- view/admin/set/user/info.html | 4 ++-- view/admin/user/list.html | 10 +++++----- view/admin/user/useredit.html | 4 ++-- view/admin/user/userform.html | 4 ++-- view/index/user/set.html | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index ee7ce21..e774f48 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -26,16 +26,16 @@ class User extends AdminController public function list() { if(Request::isAjax()){ - $data = Request::only(['id','name','email','sex']); - $map = array_filter($data); + $datas = Request::only(['id','name','email','sex']); + $map = array_filter($datas); $user = Db::name('user')->where(['delete_time'=>0])->where($map)->order('id desc')->select(); $count = $user->count(); $res = []; if($count){ + $res = ['code'=>0,'msg'=>'','count'=>$count]; foreach($user as $k => $v){ $data = ['id'=>$v['id'],'username'=>$v['name'],'avatar'=>$v['user_img'],'phone'=>$v['phone'],'email'=>$v['email'],'sex'=>$v['sex'],'ip'=>$v['last_login_ip'],'jointime'=>date("Y-m-d",$v['create_time']),'check'=>$v['status'],'auth'=>$v['auth']]; - //$res['data'][] = $data; - $res = ['code'=>0,'msg'=>'','count'=>$count,'data'=>[$data]]; + $res['data'][] = $data; } } else { $res = ['code'=>-1,'msg'=>'没有查询结果!']; diff --git a/view/admin/set/user/info.html b/view/admin/set/user/info.html index 50c9dfb..d9c1300 100644 --- a/view/admin/set/user/info.html +++ b/view/admin/set/user/info.html @@ -36,8 +36,8 @@
- - + +