Browse Source

看别人的粉丝列表,关注列表,如果别人开了隐私,看不到

lizhen_gitee 1 year ago
parent
commit
2221c6ac19
2 changed files with 18 additions and 1 deletions
  1. 0 1
      application/api/controller/Index.php
  2. 18 0
      application/api/controller/Userfollow.php

+ 0 - 1
application/api/controller/Index.php

@@ -31,7 +31,6 @@ class Index extends Api
         $where = [
             'user.id' => ['neq',$this->auth->id],
             'user.status' => 1,
-//            'user.photo_images' => ['neq',''],
             'user.cityname' => $cityname,
             'power.yinshen' => 0,
         ];

+ 18 - 0
application/api/controller/Userfollow.php

@@ -19,6 +19,15 @@ class Userfollow extends Api
             $user_id = $this->auth->id;
         }
 
+        //如果不是我,并且开了隐私,直接返回空
+        if($user_id != $this->auth->id){
+            $yinsi = $this->user_power($user_id,'yinsi');
+            if($yinsi == 1){
+                $this->success(1,[]);
+            }
+        }
+
+        //列表
         $list = Db::name('user_follow')
             ->alias('follow')
             ->join('user','follow.follow_uid = user.id','LEFT')
@@ -52,6 +61,15 @@ class Userfollow extends Api
             $user_id = $this->auth->id;
         }
 
+        //如果不是我,并且开了隐私,直接返回空
+        if($user_id != $this->auth->id){
+            $yinsi = $this->user_power($user_id,'yinsi');
+            if($yinsi == 1){
+                $this->success(1,[]);
+            }
+        }
+
+        //列表
         $list = Db::name('user_follow')
             ->alias('follow')
             ->join('user','follow.uid = user.id','LEFT')