浏览代码

接口修改

lizhen_gitee 10 月之前
父节点
当前提交
a11ae768da
共有 2 个文件被更改,包括 7 次插入5 次删除
  1. 2 3
      application/api/controller/Index.php
  2. 5 2
      application/api/controller/Usercenter.php

+ 2 - 3
application/api/controller/Index.php

@@ -139,8 +139,7 @@ class Index extends Api
         $mt_user_wallets = $mt_user_wallet->field(['id','user_id','vip_endtime','pay_money'])->whereIn('user_id',$user_to_id)->select();
 
         // 财富等级
-        $mt_wealth_levels = $mt_wealth_level->order('id desc')->select();
-        $mt_wealth_levels = array_column($mt_wealth_levels ?? [],'name','value');
+        $mt_wealth_levels = $mt_wealth_level->order('id desc')->column('value,image');
 
         foreach($list as $key => &$v) {
             if ($this->auth->gender == 1) { //用户是男的
@@ -219,7 +218,7 @@ class Index extends Api
                 $name = '';
                 foreach ($mt_wealth_levels as $kkk=>$vvv){
                     if ($pay_money > $kkk){
-                        $name = $vvv;
+                        $name = localpath_to_netpath($vvv);
                         break;
                     }
                 }

+ 5 - 2
application/api/controller/Usercenter.php

@@ -97,11 +97,10 @@ class Usercenter extends Api
 
         //用户数据
         $userinfo = info_domain_image($userinfo,['avatar','photo_images']);
-        $idcard_confirm = Db::name('user_idconfirm')->where('user_id',$uid)->find();
 
         $new_data = [
             'age'            => birthtime_to_age($userinfo['birthday']),
-            'truename'       => ($userinfo['idcard_status'] == 1 && isset($idcard_confirm['truename'])) ? $idcard_confirm['truename'] : '',
+            'truename'       => '',
             'alipay_account' => '',
         ];
 
@@ -169,6 +168,10 @@ class Usercenter extends Api
         $userinfo['follow_num'] = $follow_num;
         $userinfo['fans_num'] = $fans_num;
 
+        //访客数
+        $visit_num = Db::name('user_visit')->where(['to_uid'=>$this->auth->id])->count('id');
+        $userinfo['visit_num'] = $visit_num;
+
         //查询是否打过招呼
         $count = Db::name('user_greet')->where(['user_id' => $this->auth->id, 'user_to_id' => $uid])->count('id');
         if ($count) {