Browse Source

3个tken的隐私权限,都去掉

lizhen_gitee 1 year ago
parent
commit
0d7e9625d2

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

@@ -32,7 +32,6 @@ class Index extends Api
             'user.id' => ['neq',$this->auth->id],
             'user.status' => 1,
             //'user.cityname' => $cityname,
-            'power.yinshen' => 0,
         ];
 
         if(!empty($cityname) && $cityname != $this->auth->cityname){
@@ -121,7 +120,6 @@ class Index extends Api
         ];
         $list = Db::name('user')->alias('user')->field($field)
             ->join('user_wallet wallet','user.id = wallet.user_id','LEFT')
-            ->join('user_power power' ,'user.id = power.user_id','LEFT')
             ->join('user_active active' ,'user.id = active.user_id','LEFT')
             ->where($where)
             ->where($where_black)
@@ -161,7 +159,6 @@ class Index extends Api
         $where = [
             'user.id' => ['neq',$this->auth->id],
             'user.status' => 1,
-            'power.yinshen' => 0,
         ];
 
         //搜索条件 性别
@@ -254,7 +251,6 @@ class Index extends Api
         ];
         $list = Db::name('user')->alias('user')->field($field)
             ->join('user_wallet wallet','user.id = wallet.user_id','LEFT')
-            ->join('user_power power' ,'user.id = power.user_id','LEFT')
             ->join('user_active active' ,'user.id = active.user_id','LEFT')
             ->where($where)
             ->where($where_black)

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

@@ -152,10 +152,9 @@ class Usercenter extends Api
             $userinfo['distance'] = '未知';
         }
         //vip如果开了隐私保护,需要隐藏距离
-        $yinsi = $this->user_power($userinfo['id'],'yinsi');
-        if($yinsi == 1){
-            $userinfo['distance'] = '';
-            $userinfo['cityname'] = '';
+        $weizhi = $this->user_power($userinfo['id'],'weizhi');
+        if($weizhi == 1){
+//            $userinfo['cityname'] = '';
         }
 
         $this->success('success',$userinfo);
@@ -212,7 +211,6 @@ class Usercenter extends Api
 
 
         //查看别人信息,就要留下痕迹
-        if($this->user_power($this->auth->id,'wuhen') != 1){
             if($this->apiLimit(1,1000) == true){
                 $data = [
                     'uid' => $this->auth->id,
@@ -227,7 +225,6 @@ class Usercenter extends Api
                     Db::name('user_visit')->insertGetId($data);
                 }
             }
-        }
 
         //活跃,在线
         $userinfo['active_info'] = $this->user_activeinfo($uid);
@@ -264,10 +261,9 @@ class Usercenter extends Api
             $userinfo['distance'] = '未知';
         }
         //vip如果开了隐私保护,需要隐藏距离
-        $yinsi = $this->user_power($userinfo['id'],'yinsi');
-        if($yinsi == 1){
-            $userinfo['distance'] = '';
-            $userinfo['cityname'] = '';
+        $weizhi = $this->user_power($userinfo['id'],'weizhi');
+        if($weizhi == 1){
+//            $userinfo['cityname'] = '';
         }
 
         $this->success('success',$userinfo);

+ 1 - 17
application/api/controller/Userfollow.php

@@ -19,13 +19,6 @@ 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')
@@ -61,23 +54,14 @@ 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')
             ->join('user_wallet uw','user.id = uw.user_id','LEFT')
-            ->join('user_power power','user.id = power.user_id','LEFT')
             ->field('user.id,user.username,user.nickname,user.avatar,user.bio,user.birthday,user.gender,user.attribute,uw.vip_endtime')
             ->where('follow.follow_uid',$user_id)
-            ->where('power.yinsi',0)
             ->group('follow.uid')
             ->order('follow.id desc')->autopage()->select();
 
@@ -255,7 +239,7 @@ class Userfollow extends Api
         ];
 
         $check = Db::name('user_follow')->where($map2)->find();
-        if(empty($check) && $this->user_power($this->auth->id,'yinsi') != 1){
+        if(empty($check)){
             //防止重复刷关注,先删掉以前的,再加新的
             Db::name('message')
                 ->where('user_id',$follow_uid)

+ 0 - 4
application/api/controller/Uservisit.php

@@ -38,10 +38,8 @@ class Uservisit extends Api
         $list = Db::name('user_visit')
             ->alias('visit')
             ->join('user','visit.uid = user.id','LEFT')
-            ->join('user_power power','visit.uid = power.user_id','LEFT')
             ->field('user.id,user.username,user.nickname,user.avatar,user.bio,visit.updatetime')
             ->where('visit.to_uid',$this->auth->id)
-            ->where('power.wuhen',0)
             ->order('visit.updatetime desc')->autopage()->select();
         $list = list_domain_image($list,['avatar']);
 
@@ -52,9 +50,7 @@ class Uservisit extends Api
         }
 
         $number = Db::name('user_visit')->alias('visit')
-            ->join('user_power power','visit.uid = power.user_id','LEFT')
             ->where('visit.to_uid',$this->auth->id)
-            ->where('power.wuhen',0)
             ->count();
 
         $result = [

+ 2 - 2
application/index/controller/Plantask.php

@@ -22,8 +22,8 @@ class Plantask extends Controller
     //vip过期的,三个隐私设置改成0
     //vip过期的,更新用户表is_vip
     public function auto_vipend(){
-        $sql = 'update `mt_user_power` set yinsi = 0,yinshen = 0,wuhen = 0 where user_id in (select user_id from mt_user_wallet where vip_endtime > 0 and vip_endtime < '.time().')';
-        db()->query($sql);
+//        $sql = 'update `mt_user_power` set yinsi = 0,yinshen = 0,wuhen = 0 where user_id in (select user_id from mt_user_wallet where vip_endtime > 0 and vip_endtime < '.time().')';
+//        db()->query($sql);
 
         $sql2 = 'update `mt_user` set is_vip = 0 where is_vip = 1 and user_id in (select user_id from mt_user_wallet where vip_endtime > 0 and vip_endtime < '.time().')';
         db()->query($sql2);