From 6455e9f7ef6fa17188a46863dce4bd2c9125260f Mon Sep 17 00:00:00 2001 From: toogee Date: Sun, 22 Mar 2020 17:29:59 +0800 Subject: [PATCH] user city --- app/admin/controller/User.php | 6 +++--- view/index/user/home.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index e774f48..ac26567 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -34,7 +34,7 @@ class User extends AdminController 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']]; + $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'],'city'=>$v['city'],'logintime'=>date("Y-m-d H:i",$v['last_login_time']),'jointime'=>date("Y-m-d",$v['create_time']),'check'=>$v['status'],'auth'=>$v['auth']]; $res['data'][] = $data; } } else { @@ -102,8 +102,8 @@ class User extends AdminController { $file = request()->file('file'); try { - validate(['image'=>'filesize:2048|fileExt:jpg,png,gif|image:200,200,jpg']) - ->check(array($file)); + validate(['file'=>'fileSize:204800|fileExt:jpg,png,gif']) + ->check(['file'=>$file]); $savename = \think\facade\Filesystem::disk('public')->putFile('head_pic',$file); } catch (think\exception\ValidateException $e) { echo $e->getMessage(); diff --git a/view/index/user/home.html b/view/index/user/home.html index 88c9a35..a0f5898 100644 --- a/view/index/user/home.html +++ b/view/index/user/home.html @@ -21,7 +21,7 @@

{$u.point} 飞吻 {$u.create_time|date='Y-m-d'} 加入 - {:session('user_id') ? '来自'.$user.city:'登录查看'} + {:session('user_id') ? '来自'.$u.city:'登录查看'}

({$u.sign ?:'懒得还没有签名'})