Hello,
I've got the finder query below to get the most popular posts. How would I adjust this so that only one post per thread ID was returned?
$postFinder = $this->finder('XFost');
$postFinder
->with(['Thread.Forum.Node.Permissions|' . $visitor->permission_combination_id, 'User'])
->where('Thread.discussion_state', 'visible')
->where('message_state','visible')
->where('reaction_score', '>', 0)
->setDefaultOrder('reaction_score', 'DESC')
->limit(max($limit * 2, 10));
thanks
I've got the finder query below to get the most popular posts. How would I adjust this so that only one post per thread ID was returned?
$postFinder = $this->finder('XFost');
$postFinder
->with(['Thread.Forum.Node.Permissions|' . $visitor->permission_combination_id, 'User'])
->where('Thread.discussion_state', 'visible')
->where('message_state','visible')
->where('reaction_score', '>', 0)
->setDefaultOrder('reaction_score', 'DESC')
->limit(max($limit * 2, 10));
thanks