Browse Source

自己是否客服,不能绑自己

lizhen_gitee 11 months ago
parent
commit
5e8f56c1f0
2 changed files with 11 additions and 0 deletions
  1. 4 0
      application/api/controller/Userintro.php
  2. 7 0
      application/common/library/Auth.php

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

@@ -150,6 +150,10 @@ class Userintro extends Api
         $images  = input('images','');
         $remark = input('remark','');
 
+        if($down_uid == $this->auth->id){
+            $this->error('不能绑定自己');
+        }
+
         $where = [
             'user_id'   => $this->auth->id,
             'down_uid' => $down_uid,

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

@@ -583,6 +583,13 @@ class Auth
             $userinfo['wealth_level'] = '';
         }
 
+        //是否客服
+        $userinfo['is_kefu'] = 0;
+        $kefu_ids = config('site.kefu_user_ids');
+        if(in_array($this->id,explode(',',$kefu_ids))){
+            $userinfo['is_kefu'] = 1;
+        }
+
         return $userinfo;
     }