From a917dbc652df48e8155677ef98b214848b1b9293 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 24 Mar 2019 12:24:44 +1030 Subject: [PATCH] Fix is:unread gambit --- framework/core/src/Discussion/DiscussionRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/core/src/Discussion/DiscussionRepository.php b/framework/core/src/Discussion/DiscussionRepository.php index 588132d7b..56deb46bf 100644 --- a/framework/core/src/Discussion/DiscussionRepository.php +++ b/framework/core/src/Discussion/DiscussionRepository.php @@ -49,8 +49,8 @@ class DiscussionRepository */ public function getReadIds(User $user) { - return Discussion::leftJoin('discussions_users', 'discussions_users.discussion_id', '=', 'discussions.id') - ->where('user_id', $user->id) + return Discussion::leftJoin('discussion_user', 'discussion_user.discussion_id', '=', 'discussions.id') + ->where('discussion_user.user_id', $user->id) ->whereColumn('last_read_post_number', '>=', 'last_post_number') ->pluck('id') ->all();