Browse Source

精选、新人女性根据开关,强制实名与真人

lizhen_gitee 11 months ago
parent
commit
0498a5c8b2

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

@@ -30,6 +30,12 @@ class Index extends Api
             'user.gender' => ['neq',$this->auth->gender],
         ];
 
+        //女性强制实名,强制真人
+        if($this->auth->gender == 1 && config('site.index_women_auth_switch') == 1){
+            $where['user.idcard_status'] = 1;
+            $where['user.real_status'] = 1;
+        }
+
         if(!empty($keyworld)){
             $where['user.username|nickname'] = ['LILE','%'.$keyworld.'%'];
         }
@@ -101,6 +107,12 @@ class Index extends Api
             'user.gender' => ['neq',$this->auth->gender],
         ];
 
+        //女性强制实名,强制真人
+        if($this->auth->gender == 1 && config('site.index_women_auth_switch') == 1){
+            $where['user.idcard_status'] = 1;
+            $where['user.real_status'] = 1;
+        }
+
         if(!empty($keyworld)){
             $where['user.username|nickname'] = ['LILE','%'.$keyworld.'%'];
         }

+ 5 - 1
application/api/controller/User.php

@@ -513,7 +513,8 @@ class User extends Api
             $data['avatar'] = $data['gender'] == 1 ? config('avatar_boy') : config('avatar_girl');
         }
 
-        if(isset($data['gender']) && $data['gender'] == 1){
+        //初次设置性别为 男
+        if(isset($data['gender']) && $data['gender'] == 1 && $this->auth->gender == -1){
             //男性赠送
             $gift_data = [
                 'audio_sec' => config('site.man_reg_audio_sec'),
@@ -521,6 +522,9 @@ class User extends Api
                 'typing_times' => config('site.man_reg_typing_times'),
             ];
             Db::name('user_wallet')->where('id',$this->auth->id)->update($gift_data);
+
+            //修改财富值等级为1级
+            $data['wealth_level'] = 1;
         }
 
 

+ 1 - 0
application/extra/site.php

@@ -120,4 +120,5 @@ return array (
   'usersite_matchinfo_switch' => '1',
   'man_index_dashan_pushtimes' => '3',
   'woman_index_dashan_pushtimes' => '3',
+  'index_women_auth_switch' => '0',
 );