Browse Source

选话题

wzq 5 years ago
parent
commit
40ae181d53
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/Repositories/PostRepositories.php

+ 2 - 2
app/Repositories/PostRepositories.php

@@ -475,13 +475,13 @@ class PostRepositories
         $perPage = isset($request['per_page']) ? $request['per_page'] : 20;
 
         $where = [];
-        if(isset($request['category_id'])){
+        if(isset($request['category_id']) && $request['category_id']){
            $topic = $this->topic->join('category_topic', 'category_topic.topic_id', '=', 'topic.id')->select('topic.*');
            $where[] = ['category_topic.category_id', $request['category_id']];
         }else{
             $topic = $this->topic;
         }
-        if(isset($request['is_suggest'])){
+        if(isset($request['is_suggest']) && $request['is_suggest']){
             $where[] = ['topic.is_hot', $request['is_suggest']];
         }