Browse Source

隐藏黑卡会员

15954078560 2 years ago
parent
commit
b0c90d175f
2 changed files with 13 additions and 4 deletions
  1. 6 1
      application/api/controller/Index.php
  2. 7 3
      application/api/controller/User.php

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

@@ -823,7 +823,12 @@ class Index extends Api
     
     //体验会员列表
     public function experiencevip() {
-        $list = Db::name('vip')->where(['id' => ['gt', $this->auth->maxlevel], 'status' => 1])->select();
+        $where = [];
+        if ($this->auth->maxlevel != 5) {
+            $where['id'] = ['neq', 5];
+        }
+
+        $list = Db::name('vip')->where(['id' => ['gt', $this->auth->maxlevel], 'status' => 1])->where($where)->select();
 
         $vip_privilege = Db::name('vip_privilege');
         foreach ($list as &$v) {

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

@@ -1389,7 +1389,7 @@ class User extends Api
         $vip_info = Db::name('vip')->find($user['maxlevel']);
         //下一级所需成长值
         $next_vip = Db::name('vip')->where(['id' => ['gt', $user['maxlevel']]])->find();
-        if (!$next_vip) {
+        if (!$next_vip || $next_vip['id'] == 5) {
             //顶部信息
             $vip_info['vip_desc'] = '已是最高会员';
             //成长值百分比0-100
@@ -1419,7 +1419,7 @@ class User extends Api
         $vip_info = Db::name('vip')->find($user['growthlevel']);
         //下一级所需成长值
         $next_vip = Db::name('vip')->where(['id' => ['gt', $user['growthlevel']]])->find();
-        if (!$next_vip) {
+        if (!$next_vip || $next_vip['id'] == 5) {
             //顶部信息
             $vip_info['vip_desc'] = '已是最高会员';
             //成长值百分比0-100
@@ -1432,7 +1432,11 @@ class User extends Api
             $vip_info['growthvalue_percentage'] = ceil($user['growthvalue'] / $next_vip['growthvalue'] * 100);
         }
         //所有会员列表
-        $list = Db::name('vip')->select();
+        $where = [];
+        if ($this->auth->maxlevel != 5) {
+            $where['id'] = ['neq', 5];
+        }
+        $list = Db::name('vip')->where($where)->select();
 
         $vip_privilege = Db::name('vip_privilege');
         foreach ($list as $k => &$v) {