# vote plugin 的 User trust level filter 失效？

**URL:** https://meta.discourse.org/t/user-trust-level-filter-not-working-for-vote-plugin/233105
**Category:** Data & reporting
**Tags:** topic-voting, sql-query
**Created:** [2022年七月17日 14:56 UTC](https://meta.discourse.org/t/user-trust-level-filter-not-working-for-vote-plugin/233105 "2022-07-17T14:56:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Matt0x01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt0x01/32/264811_2.png) [@Matt0x01](https://meta.discourse.org/u/Matt0x01)
#### Post date: [2022年七月17日 14:56 UTC](https://meta.discourse.org/t/user-trust-level-filter-not-working-for-vote-plugin/233105/1 "2022-07-17T14:56:17Z")

</div>

标题有问题。有什么办法可以解决吗？

```plaintext
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

```

---

<div class="post-metadata">

### Author: ![Matt0x01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt0x01/32/264811_2.png) [@Matt0x01](https://meta.discourse.org/u/Matt0x01)
#### Post date: [2022年七月18日 16:11 UTC](https://meta.discourse.org/t/user-trust-level-filter-not-working-for-vote-plugin/233105/2 "2022-07-18T16:11:01Z")

</div>

编辑：已解决。使用了 voting\_votes 和 count 函数

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2022年八月17日 16:11 UTC](https://meta.discourse.org/t/user-trust-level-filter-not-working-for-vote-plugin/233105/3 "2022-08-17T16:11:30Z")

</div>

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