wzq 5 lat temu
rodzic
commit
932ca8ec0c

+ 1 - 1
app/Repositories/PostRepositories.php

@@ -386,7 +386,7 @@ class PostRepositories
         return $this->post
             ->join('post_data', 'post_data.post_id', '=', 'post.id')
             ->select('post.*')
-//            ->whereRaw('FIND_IN_SET(' . $request['id'] . ',post.topic_ids)')
+            ->whereRaw('FIND_IN_SET(' . $request['id'] . ',post.topic_ids)')
             ->orderBy('id','desc')
             ->paginate($perPage);
     }

+ 4 - 4
app/Transformers/Post/SuggestTransformer.php

@@ -48,10 +48,10 @@ class SuggestTransformer extends TransformerAbstract
             ];
         }
         $isFollow = 0;
-//        $followStatus = $this->getFollowStatus($this->uid, $post['uid']);
-//        if($followStatus){
-//            $isFollow = $followStatus;
-//        }
+        $followStatus = $this->getFollowStatus($this->uid, $post['uid']);
+        if($followStatus){
+            $isFollow = $followStatus;
+        }
         return [
             'show_type' => 'post',
             'id' => $post['id'],

+ 4 - 6
routes/api.php

@@ -26,10 +26,6 @@ $api->version('v1', [
     $api->group(['middleware' => ['chxq_jwt_auth']], function ($api) {
         //内容详情
         $api->get('post/detail', 'PostController@detail');
-        //获取话题
-        $api->get('topic/group', 'PostController@getTopic');
-        //话题内容列表
-        $api->get('post/topic', 'PostController@topicPost');
     });
     $api->get('post/suggest2', 'PostController@suggestPost');
     //登录+验签
@@ -54,10 +50,12 @@ $api->version('v1', [
         $api->get('topicCategory', 'CategoryController@index');
         //获取话题
         $api->get('topicCategory/getTopics', 'CategoryController@getTopics');
-
+        //获取话题
+        $api->get('topic/group', 'PostController@getTopic');
+        //话题内容列表
+        $api->get('post/topic', 'PostController@topicPost');
         //话题列表
         $api->get('topic', 'PostController@topicList');
-
         //获取内容视频组
         $api->get('post/video/group', 'PostController@getPostVideo');
         //话题详情