Skip to content

Commit 5b7f633

Browse files
committed
Small fix for thread index
1 parent 351b0ad commit 5b7f633

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/Lio/Forum/Threads/ThreadRepository.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,20 @@ public function getByTagsAndStatusPaginated(Collection $tags, $status, $perPage
3333
if ($tags->count() > 0) {
3434
$query->join('tagged_items', 'forum_threads.id', '=', 'tagged_items.thread_id')
3535
->whereIn('tagged_items.tag_id', $tags->lists('id'));
36-
$query->groupBy('forum_threads.id');
3736
}
3837

3938
if ($status) {
4039
if ($status == 'solved') {
4140
$query->where('solution_reply_id', '>', 0);
4241
}
42+
4343
if ($status == 'open') {
4444
$query->whereNull('solution_reply_id');
4545
}
4646
}
4747

48+
$query->groupBy('forum_threads.id');
49+
4850
$query->orderBy('pinned', 'desc');
4951
$query->orderBy('updated_at', 'desc');
5052

0 commit comments

Comments
 (0)