Browse Source

首页匹配

lizhen_gitee 1 year ago
parent
commit
eeb7ca5cc4

+ 1 - 4
application/api/controller/Baseconfig.php

@@ -16,12 +16,9 @@ class Baseconfig extends Api
     public function index(){
 
         $config = [
-//            'android_update_num'     => config('site.android_update_num'),
-//            'android_update_version' => config('site.android_update_version'),
-//            'ios_update_num'         => config('site.ios_update_num'),
-//            'ios_update_version'     => config('site.ios_update_version'),
             'comment_for_gold_switch'     => config('site.comment_for_gold_switch'),//好评有礼开关
             'kefu_user_ids'            => config('site.kefu_user_ids'),//在线客服人员
+            'index_pipei_switch'    => config('site.index_pipei_switch'), //首页匹配功能开关
         ];
 
         $this->success('success',$config);

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

@@ -110,6 +110,8 @@ class Index extends Api
         $this->success(1,$list);
     }
 
+    //推荐
+    //真人认证的,是推荐用户的,可能也要限制vip的
     public function tuijian(){
         $cityname = input('cityname',$this->auth->cityname);
 
@@ -212,6 +214,41 @@ class Index extends Api
         $this->success(1,$list);
     }
 
+    //匹配
+    //做防止重复处理,参照荔枝
+    public function pipei(){
+
+        //检查剩余次数
+
+
+        $where = [
+            'user.id' => ['neq',$this->auth->id],
+            'user.status' => 1,
+        ];
+
+        //性别
+        $gender = input('gender','all');
+        if($gender != 'all'){
+            $where['user.gender'] = $gender;
+        }
+
+        //排除黑名单的
+        $black_ids = Db::name('user_black')->where(['uid'=>$this->auth->id])->column('black_uid');
+        if(!empty($black_ids)){
+            $where['user.id'] = ['NOTIN',$black_ids];
+        }
+
+
+        $list = Db::name('user')->alias('user')
+            ->join('user_active active' ,'user.id = active.user_id','LEFT')
+            ->where($where)
+            ->column('user.id');
+
+        $this->success(1,$list);
+
+
+    }
+
 
 
 

+ 2 - 0
application/extra/site.php

@@ -65,4 +65,6 @@ return array (
   'max_withdrawal_money' => '10000',
   'withdrawal_plat_bili' => '6',
   'index_tuijian_vip_limit' => '0',
+  'index_pipei_switch' => '1',
+  'index_pipei_oneday_user_times' => '5',
 );