Преглед на файлове

动态,没关注任何人时,默认给个不可能的条件

lizhen_gitee преди 1 година
родител
ревизия
efe3e5ad2b
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 5 2
      application/api/controller/Topicdongtai.php

+ 5 - 2
application/api/controller/Topicdongtai.php

@@ -191,7 +191,6 @@ class Topicdongtai extends Api
         $topic_id = input('topic_id',0);
         $where_exp = [];
         if($topic_id){
-//            $where['dt.topic_id'] = $topic_id;
             $where_exp[] = ['exp',Db::raw("FIND_IN_SET('".$topic_id."',dt.topic_ids)")];
         }
         //最新
@@ -226,13 +225,17 @@ class Topicdongtai extends Api
                 $where_follow .= $where_topic;
             }
 
+            //默认
+            if($where_follow == ''){
+                $where_follow = 'dt.id = 0';
+            }
         }
 
 
         //附近,根据距离排序
         if($order == 'near'){
 //            $where['dt.cityname'] = $this->auth->cityname;
-            $orderby  = 'distance asc,dt.toptime desc';
+            $orderby  = 'dt.toptime desc,distance asc,';
         }
 
         //性别