lizhen_gitee 2 달 전
부모
커밋
e7d8f34ea6
2개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  1. 3 1
      application/api/controller/User.php
  2. 6 6
      application/common/library/Auth.php

+ 3 - 1
application/api/controller/User.php

@@ -158,7 +158,6 @@ class User extends Api
             $this->error('您的网络开小差啦~');
             $this->error('您的网络开小差啦~');
         }
         }
 
 
-        //$data = $this->userInfo('return');
         $data['gender'] = $edit_data['gender'];
         $data['gender'] = $edit_data['gender'];
         $data['avatar'] = $edit_data['avatar'];
         $data['avatar'] = $edit_data['avatar'];
 
 
@@ -264,6 +263,9 @@ class User extends Api
     //用户详细资料
     //用户详细资料
     public function userInfo($type = 1){
     public function userInfo($type = 1){
         $info = $this->auth->getUserinfo();
         $info = $this->auth->getUserinfo();
+
+        $info['is_vip'] = $this->is_vip($info['vip_endtime'],$info['vip_level']);
+
         if($type == 'return'){
         if($type == 'return'){
             return $info;
             return $info;
         }
         }

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

@@ -727,7 +727,7 @@ class Auth
         //vip
         //vip
         $userwallet = Db::name('user_wallet')->where('user_id',$this->id)->find();
         $userwallet = Db::name('user_wallet')->where('user_id',$this->id)->find();
         $userinfo['vip_endtime'] = $userwallet['vip_endtime'];
         $userinfo['vip_endtime'] = $userwallet['vip_endtime'];
-        $userinfo['is_vip'] = $this->is_vip($userwallet['vip_endtime'],$userwallet['vip_level']);
+        $userinfo['vip_level'] = $userwallet['vip_level'];
         $userinfo['vip_chat_discount'] = config('site.vip_chat_discount') ? : 10; //vip聊天折扣
         $userinfo['vip_chat_discount'] = config('site.vip_chat_discount') ? : 10; //vip聊天折扣
         $userinfo['vip_video_discount'] = config('site.vip_video_discount') ? : 10; //vip视频折扣
         $userinfo['vip_video_discount'] = config('site.vip_video_discount') ? : 10; //vip视频折扣
 
 
@@ -771,14 +771,14 @@ class Auth
         }
         }
 
 
         //查询财富等级和魅力等级
         //查询财富等级和魅力等级
-        $wallet_info = Db::name('user_wallet')->where(['user_id' => $this->id])->find();
-        $wealth_level = Db::name('wealth_level')->where(['value' => ['elt', $wallet_info['pay_money']]])->order('id desc')->find();
+
+        $wealth_level = Db::name('wealth_level')->where(['value' => ['elt', $userwallet['pay_money']]])->order('id desc')->find();
         if ($wealth_level) {
         if ($wealth_level) {
             $userinfo['wealth_level'] = localpath_to_netpath($wealth_level['image']);
             $userinfo['wealth_level'] = localpath_to_netpath($wealth_level['image']);
         } else {
         } else {
             $userinfo['wealth_level'] = '';
             $userinfo['wealth_level'] = '';
         }
         }
-        $charm_level = Db::name('charm_level')->where(['value' => ['elt', $wallet_info['get_money']]])->order('id desc')->find();
+        $charm_level = Db::name('charm_level')->where(['value' => ['elt', $userwallet['get_money']]])->order('id desc')->find();
         if ($charm_level) {
         if ($charm_level) {
             $userinfo['charm_level'] = localpath_to_netpath($charm_level['image']);
             $userinfo['charm_level'] = localpath_to_netpath($charm_level['image']);
         } else {
         } else {
@@ -801,10 +801,10 @@ class Auth
         $userinfo['dongtai_num'] = Db::name('topic_dongtai')->where(['user_id' => $this->id, 'is_hidden' => 0, 'type' => ['in', [1, 2]], 'status' => 0, 'auit_status' => 1])->count();
         $userinfo['dongtai_num'] = Db::name('topic_dongtai')->where(['user_id' => $this->id, 'is_hidden' => 0, 'type' => ['in', [1, 2]], 'status' => 0, 'auit_status' => 1])->count();
 
 
         //收益
         //收益
-        $userinfo['money'] = model('wallet')->getWallet($this->id,'money');
+        $userinfo['money'] = $userwallet['money'];
 
 
         //金币
         //金币
-        $userinfo['gold'] = model('wallet')->getWallet($this->id,'gold');
+        $userinfo['gold'] = $userwallet['gold'];
 
 
         return $userinfo;
         return $userinfo;
     }
     }