|
@@ -293,16 +293,6 @@ class Usercenter extends Api
|
|
|
//用户数据
|
|
|
$userinfo = info_domain_image($userinfo,['avatar','photo_images']);
|
|
|
|
|
|
- $new_data = [
|
|
|
- 'age' => birthtime_to_age($userinfo['birthday']),
|
|
|
- ];
|
|
|
-
|
|
|
- //合并
|
|
|
- $userinfo = array_merge($userinfo,$new_data);
|
|
|
- //枚举
|
|
|
- $userinfo['tag'] = Db::name('enum_tag')->where('id','IN',$userinfo['tag_ids'])->field(['id','name','color'])->select();
|
|
|
-
|
|
|
-
|
|
|
//是否关注
|
|
|
$userinfo['is_follow'] = $this->is_follow($this->auth->id,$uid);
|
|
|
|
|
@@ -355,6 +345,34 @@ class Usercenter extends Api
|
|
|
$this->success('success',$userinfo);
|
|
|
|
|
|
}
|
|
|
+ public function getuserinfo_domain2(){
|
|
|
+ $uid = input_post('uid',0);
|
|
|
+
|
|
|
+ $field = $this->allowFields;
|
|
|
+ $userinfo = Db::name('user')->field($field)->where('id',$uid)->find();
|
|
|
+
|
|
|
+ if(!$userinfo){
|
|
|
+ $this->error('不存在的用户');
|
|
|
+ }
|
|
|
+
|
|
|
+ $new_data = [
|
|
|
+ 'age' => birthtime_to_age($userinfo['birthday']),
|
|
|
+ ];
|
|
|
+
|
|
|
+ //合并
|
|
|
+ $userinfo = array_merge($userinfo,$new_data);
|
|
|
+ //枚举
|
|
|
+ $userinfo['tag'] = Db::name('enum_tag')->where('id','IN',$userinfo['tag_ids'])->field(['id','name','color'])->select();
|
|
|
+
|
|
|
+ //vip如果开了隐私保护,需要隐藏距离
|
|
|
+ $yinsi = $this->user_power($userinfo['id'],'yinsi');
|
|
|
+ if($yinsi == 1){
|
|
|
+ $userinfo['cityname'] = '';
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->success('success',$userinfo);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|