|
@@ -266,8 +266,10 @@ class Topicdongtai extends Api
|
|
|
|
|
|
|
|
|
//附近,根据距离排序
|
|
|
+ $having_dis = '';
|
|
|
if($order == 'near'){
|
|
|
- $where['dt.provincename'] = $this->auth->provincename;
|
|
|
+// $where['dt.provincename'] = $this->auth->provincename;
|
|
|
+ $having_dis = 'distance < ' . 100000; //100公里范围
|
|
|
$orderby = 'dt.toptime desc,distance asc';
|
|
|
}
|
|
|
|
|
@@ -302,8 +304,11 @@ class Topicdongtai extends Api
|
|
|
->where($where)
|
|
|
->where($where_exp)
|
|
|
->where($where_follow)
|
|
|
- ->where($where_black)
|
|
|
- ->order($orderby)
|
|
|
+ ->where($where_black);
|
|
|
+ if($order == 'near'){
|
|
|
+ $list = $list->having($having_dis);
|
|
|
+ }
|
|
|
+ $list = $list->order($orderby)
|
|
|
->autopage()->select();
|
|
|
$list = list_domain_image($list,['images','audio_file','avatar']);
|
|
|
|