Browse Source

与你有缘,推送搭讪人

lizhen_gitee 10 months ago
parent
commit
1bd6a70779

+ 45 - 1
application/api/controller/Match.php

@@ -693,10 +693,54 @@ class Match extends Api
         $this->success('亲密度等级信息', $data);
     }
 
+    //与你有缘 推送搭讪人
+    public function getindex_dashan(){
+        //强制条件
+        $map = [
+            'user.status' =>1,                                       //未封禁用户
+            'user.gender' => $this->auth->gender == 1 ? 0 : 1,       //异性
+        ];
+
+        //找到没聊过的人
+        if ($this->auth->gender == 1) {
+            $where = [
+                'user_id' => $this->auth->id,
+            ];
+            $uids = Db::name('user_match_typing_log')->where($where)->column('to_user_id');
+        }else{
+            $where = [
+                'to_user_id' => $this->auth->id,
+            ];
+            $uids = Db::name('user_match_typing_log')->where($where)->column('user_id');
+        }
+        $map2 = [
+            'user.id' => ['NOTIN',$uids],
+        ];
+
+        $lists = Db::name('user')->alias('user')->field('user.id,user.gender,user.birthday,user.avatar,user.nickname')
+            ->where($map)->where($map2)->order('user.logintime desc')->limit(6)->select();
+
+        if(empty($lists)){
+            $lists = Db::name('user')->alias('user')->field('user.id,user.gender,user.birthday,user.avatar,user.nickname')
+                ->where($map)->order('user.logintime desc')->limit(6)->select();
+        }
+
+        if(!empty($lists)){
+            foreach($lists as $key => &$val){
+                $val = info_domain_image($val,['avatar']);
+
+                $val['age'] = birthtime_to_age($val['birthday']);
+                unset($val['birthday']);
+
+            }
+        }
+
+        $this->success('success',$lists);
+    }
 
     //聊天匹配
     public function gettypinguser(){
-
+        exit;//不需要这个接口
         //给出备选用户
         $map = [
             'user.status' =>1,                                       //未封禁用户

+ 1 - 1
application/api/controller/Userfollow.php

@@ -89,7 +89,7 @@ class Userfollow extends Api
             ->join('user ou'        ,'ui.other_uid = ou.id','LEFT')
 //            ->join('user_active oua','ui.other_uid = oua.user_id','LEFT')
             ->where('(ui.uid = '.$this->auth->id.') or (ui.other_uid = '.$this->auth->id.')')
-            ->where('ui.value','gt','1')
+            ->where('ui.value','gt','0.1')
             ->order('ui.value desc, ui.id desc')->autopage()->select();
 //        dump($intimacy);
 

+ 2 - 0
application/extra/site.php

@@ -118,4 +118,6 @@ return array (
   'man_reg_typing_times' => '5',
   'match_bg_music' => '/uploads/20240408/1aa22b2ee9d21cbe84f4e4cbbe6d52af.mp3',
   'usersite_matchinfo_switch' => '1',
+  'man_index_dashan_pushtimes' => '3',
+  'woman_index_dashan_pushtimes' => '3',
 );