瀏覽代碼

个人主页,首页显示魅力等级财富等级

lizhen_gitee 11 月之前
父節點
當前提交
e8d2cef5ab
共有 3 個文件被更改,包括 28 次插入15 次删除
  1. 16 14
      application/api/controller/Index.php
  2. 6 0
      application/api/controller/Usercenter.php
  3. 6 1
      application/common/library/Auth.php

+ 16 - 14
application/api/controller/Index.php

@@ -48,30 +48,31 @@ class Index extends Api
             'user.avatar',
             'user.idcard_status',
             'user.real_status',
-            'user.photo_images',
             'user.gender',
             'user.birthday',
             'user.is_active',
             'user.bio',
+            'user.wealth_level',
+            'user.charm_level',
 
             'wallet.vip_endtime',
-            'active.requesttime',
+
+            'wealth.image as wealth_image',
+            'charm.image  as charm_image',
         ];
         $list = Db::name('user')->alias('user')->field($field)
             ->join('user_wallet wallet','user.id = wallet.user_id','LEFT')
-            ->join('user_active active' ,'user.id = active.user_id','LEFT')
+            ->join('wealth_level wealth','user.wealth_level = wealth.level','LEFT')
+            ->join('charm_level charm','user.charm_level = charm.level','LEFT')
             ->where($where)
             ->where($where_black)
             ->order('user.is_active desc,user.id desc')
             ->autopage()
             ->select();
-        $list = list_domain_image($list,['avatar','photo_images']);
+        $list = list_domain_image($list,['avatar','photo_images','wealth_image','charm_image']);
         foreach($list as $key => &$val){
             $val['age'] = birthtime_to_age($val['birthday']);
             $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
-
-            $val['active_info'] = $this->user_activeinfo($val['id'],$val['requesttime']);
-
         }
 
         $this->success(1,$list);
@@ -105,30 +106,31 @@ class Index extends Api
             'user.avatar',
             'user.idcard_status',
             'user.real_status',
-            'user.photo_images',
             'user.gender',
             'user.birthday',
             'user.is_active',
             'user.bio',
+            'user.wealth_level',
+            'user.charm_level',
 
             'wallet.vip_endtime',
-            'active.requesttime',
+
+            'wealth.image as wealth_image',
+            'charm.image  as charm_image',
         ];
         $list = Db::name('user')->alias('user')->field($field)
             ->join('user_wallet wallet','user.id = wallet.user_id','LEFT')
-            ->join('user_active active' ,'user.id = active.user_id','LEFT')
+            ->join('wealth_level wealth','user.wealth_level = wealth.level','LEFT')
+            ->join('charm_level charm','user.charm_level = charm.level','LEFT')
             ->where($where)
             ->where($where_black)
             ->order('user.is_active desc,user.id desc')
             ->autopage()
             ->select();
-        $list = list_domain_image($list,['avatar','photo_images']);
+        $list = list_domain_image($list,['avatar','photo_images','wealth_image','charm_image']);
         foreach($list as $key => &$val){
             $val['age'] = birthtime_to_age($val['birthday']);
             $val['is_vip'] = $val['vip_endtime'] > time() ? 1 : 0;
-
-            $val['active_info'] = $this->user_activeinfo($val['id'],$val['requesttime']);
-
         }
 
         $this->success(1,$list);

+ 6 - 0
application/api/controller/Usercenter.php

@@ -50,6 +50,8 @@ class Usercenter extends Api
         'match_audio_price',
         'match_typing_price',
 
+        'wealth_level','charm_level',
+
     ];
     protected $allowFields_simple = [
         'id',
@@ -264,6 +266,10 @@ class Usercenter extends Api
         //价格显示开关
         $userinfo['usersite_matchinfo_switch'] = config('site.usersite_matchinfo_switch');
 
+        //财富等级,魅力等级
+        $userinfo['wealth_info'] = Db::name('wealth_level')->where('level',$userinfo['wealth_level'])->find();
+        $userinfo['charm_info']  = Db::name('charm_level')->where('level',$userinfo['charm_level'])->find();
+
         $this->success('success',$userinfo);
 
     }

+ 6 - 1
application/common/library/Auth.php

@@ -65,7 +65,9 @@ class Auth
 
         'jinyantype',
         'jinyantime',
-        'open_match_video','open_match_audio','match_video_price','match_audio_price','match_typing_price'
+        'open_match_video','open_match_audio','match_video_price','match_audio_price','match_typing_price',
+
+        'wealth_level','charm_level',
     ];
 
     public function __construct($options = [])
@@ -537,6 +539,9 @@ class Auth
         //价格显示开关
         $userinfo['usersite_matchinfo_switch'] = config('site.usersite_matchinfo_switch');
 
+        //财富等级,魅力等级
+        $userinfo['wealth_info'] = Db::name('wealth_level')->where('level',$this->wealth_level)->find();
+        $userinfo['charm_info']  = Db::name('charm_level')->where('level',$this->charm_level)->find();
 
         return $userinfo;
     }