Fix is:unread gambit

This commit is contained in:
Toby Zerner 2019-03-24 12:24:44 +10:30
parent db10172890
commit a917dbc652

View File

@ -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();