|
@@ -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, //未封禁用户
|