User trust level filter not working for vote plugin?

Issue in title. Any idea how to fix?

SELECT 
dvc.votes_count AS vote_count,
t.id AS topic_id


FROM topics t
    INNER JOIN discourse_voting_topic_vote_count dvc ON dvc.topic_id = t.id
    INNER JOIN users u ON t.user_id = u.id
    INNER JOIN post_actions pa ON pa.user_id = u.id
    INNER JOIN users u2 ON pa.user_id = u2.id
WHERE t.category_id = 20
    AND u2.trust_level >= 1
    
GROUP BY dvc.votes_count, t.id, pa.user_id
ORDER BY vote_count DESC

EDIT: Solved. Used voting_votes and count function

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.