|
@@ -90,6 +90,7 @@ class Index extends Api
|
|
|
'user.longitude',
|
|
|
'user.latitude',
|
|
|
'user.attribute',
|
|
|
+ 'user.is_active',
|
|
|
|
|
|
'wallet.vip_endtime',
|
|
|
'(st_distance(point (' . $this->auth->longitude . ', ' . $this->auth->latitude . '),point(user.longitude,user.latitude))*111195) as distance',
|
|
@@ -102,7 +103,7 @@ class Index extends Api
|
|
|
->where($where)
|
|
|
->where($where_black)
|
|
|
->having($having_dis)
|
|
|
- ->order('distance asc')
|
|
|
+ ->order('user.is_active desc,distance asc')
|
|
|
->autopage()
|
|
|
->select();
|
|
|
$list = list_domain_image($list,['avatar','photo_images']);
|
|
@@ -122,7 +123,10 @@ class Index extends Api
|
|
|
//推荐
|
|
|
//真人认证的,是推荐用户的,可能也要限制vip的
|
|
|
public function tuijian(){
|
|
|
- $cityname = input('cityname',$this->auth->cityname);
|
|
|
+ $cityname = input('cityname','');
|
|
|
+ if(empty($cityname)){
|
|
|
+ $cityname = $this->auth->cityname;
|
|
|
+ }
|
|
|
|
|
|
$where = [
|
|
|
'user.id' => ['neq',$this->auth->id],
|
|
@@ -198,6 +202,7 @@ class Index extends Api
|
|
|
'user.longitude',
|
|
|
'user.latitude',
|
|
|
'user.attribute',
|
|
|
+ 'user.is_active',
|
|
|
|
|
|
'wallet.vip_endtime',
|
|
|
'(st_distance(point (' . $this->auth->longitude . ', ' . $this->auth->latitude . '),point(user.longitude,user.latitude))*111195) as distance',
|
|
@@ -210,7 +215,7 @@ class Index extends Api
|
|
|
->where($where)
|
|
|
->where($where_black)
|
|
|
->having($having_dis)
|
|
|
- ->order('distance asc')
|
|
|
+ ->order('user.is_active desc,distance asc')
|
|
|
->autopage()
|
|
|
->select();
|
|
|
$list = list_domain_image($list,['avatar','photo_images']);
|