Browse Source

分销入口

lizhen_gitee 2 months ago
parent
commit
8c048cfe7e
2 changed files with 6 additions and 0 deletions
  1. 4 0
      application/api/controller/Intro.php
  2. 2 0
      application/common/library/Auth.php

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

@@ -18,6 +18,10 @@ class Intro extends Api
         parent::__construct();
 
         $this->wallet = Db::name('user_wallet')->where('user_id',$this->auth->id)->find();
+
+        if($this->wallet['intro_level'] == -1){
+            $this->error('没有权限');
+        }
     }
 
     //首页

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

@@ -460,6 +460,8 @@ class Auth
 
         $userinfo['wallet'] = model('wallet')->getWallet($this->id);
 
+        $userinfo['is_fenxiao'] = ($userinfo['wallet']['intro_level'] != -1) ? 1 : 0;
+
         return $userinfo;
     }