Przeglądaj źródła

Merge branch 'master' of http://git.huxiukeji.com/lizhen/xiaoyou

panda 6 miesięcy temu
rodzic
commit
2cad7a7607

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

@@ -143,13 +143,13 @@ class Usercenter extends Api
         $userinfo['is_black'] = $is_black ? 1 : 0;
 
         //关注人数,粉丝人数
-        $follow_num = Db::name('user_follow')->where(['uid'=>$this->auth->id])->count('id');
-        $fans_num   = Db::name('user_follow')->where(['follow_uid'=>$this->auth->id])->count('id');
+        $follow_num = Db::name('user_follow')->where(['uid'=>$uid])->count('id');
+        $fans_num   = Db::name('user_follow')->where(['follow_uid'=>$uid])->count('id');
         $userinfo['follow_num'] = $follow_num;
         $userinfo['fans_num'] = $fans_num;
 
         //访客数
-        $visit_num = Db::name('user_visit')->where(['to_uid'=>$this->auth->id])->count('id');
+        $visit_num = Db::name('user_visit')->where(['to_uid'=>$uid])->count('id');
         $userinfo['visit_num'] = $visit_num;
 
         //查询是否打过招呼
@@ -285,11 +285,17 @@ class Usercenter extends Api
         }
 
         if(empty($gift_user_typing) && !empty($gift_user_dongtai)){
-            return $gift_user_dongtai;
+            foreach($gift_user_dongtai as $key => $val){
+                $result[] = $val;
+            }
+            return $result;
         }
 
         if(!empty($gift_user_typing) && empty($gift_user_dongtai)){
-            return $gift_user_typing;
+            foreach($gift_user_typing as $key => $val){
+                $result[] = $val;
+            }
+            return $result;
         }
 
         //合并

+ 8 - 2
application/common/library/Auth.php

@@ -864,11 +864,17 @@ class Auth
         }
 
         if(empty($gift_user_typing) && !empty($gift_user_dongtai)){
-            return $gift_user_dongtai;
+            foreach($gift_user_dongtai as $key => $val){
+                $result[] = $val;
+            }
+            return $result;
         }
 
         if(!empty($gift_user_typing) && empty($gift_user_dongtai)){
-            return $gift_user_typing;
+            foreach($gift_user_typing as $key => $val){
+                $result[] = $val;
+            }
+            return $result;
         }
 
         //合并