ソースを参照

动态大调整

lizhen_gitee 1 年間 前
コミット
bd0ac68252
1 ファイル変更7 行追加7 行削除
  1. 7 7
      application/api/controller/Topicdongtai.php

+ 7 - 7
application/api/controller/Topicdongtai.php

@@ -482,24 +482,24 @@ class Topicdongtai extends Api
 
     //某个圈子里的动态列表,最新,推荐
     public function topic_list(){
+        $where = [];
         $topic_id = input('topic_id',0);
-        $order = input('orderby','new');
+        if($topic_id){
+            $where['dt.topic_id'] = $topic_id;
+        }
 
+        $order = input('orderby','new');
         $orderby  = 'dt.id desc';
         if($order == 'hot'){
             $orderby = 'dt.goodnum desc';
         }
 
-        $where = [];
-        if($topic_id){
-            $where['dt.topic_id'] = $topic_id;
-        }
 
         if($order == 'follow'){
-            $follow_user_ids = Db::name('user_fans_follow')->where(['fans_id'=>$this->auth->id])->column('user_id');
+            $follow_user_ids = Db::name('user_follow')->where(['uid'=>$this->auth->id])->column('follow_uid');
             $where['dt.user_id'] = ['IN',$follow_user_ids];
         }
-
+////
         //排除屏蔽的
         $screen_ids = Db::name('topic_dongtai_screen')->where('user_id',$this->auth->id)->column('dt_id');
         if(!empty($screen_ids)){