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