# 从信任级别中排除某些类别

**URL:** https://meta.discourse.org/t/exclude-certain-categories-from-the-trust-levels/222513
**Category:** Marketplace
**Created:** [2022年三月30日 10:55 UTC](https://meta.discourse.org/t/exclude-certain-categories-from-the-trust-levels/222513 "2022-03-30T10:55:04Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [2022年四月5日 00:07 UTC](https://meta.discourse.org/t/exclude-certain-categories-from-the-trust-levels/222513/13 "2022-04-05T00:07:13Z")

</div>

据我理解，徽章可以满足您在 SQL 查询中能写出的任意数量的条件。我知道两个相关的讨论主题，其中包含示例：

> [@Some common badge queries](https://meta.discourse.org/t/some-common-badge-queries-idea/31859):
>
> warning Enabling Badge SQL entails security and performance risks so it is not available by default. For more information, see: [Enable Badge SQL](https://meta.discourse.org/t/badge-sql-can-no-longer-be-edited-by-default/47894) Here are some common badge queries which you can use to create your own awesome badge! Grant a badge if user has created at least one topic in the “foo”\* category \*(“foo” is the category name, not the category slug) SELECT p.user\_id, min(p.created\_at) granted\_at, MIN(p.id) post\_id FROM badge\_posts p JOIN topics t ON t.id = p.topic\_id WHERE cate…

> [@\[Superseded\] What cool badge queries have you come up with?](https://meta.discourse.org/t/what-cool-badge-queries-have-you-come-up-with/18978):
>
> warning Enabling Badge SQL entails security and performance risks so it is not available by default. For more information, see: [Enable Badge SQL](https://meta.discourse.org/t/badge-sql-can-no-longer-be-edited-by-default/47894) This topic became too long to be easily searched and has been broken down into separate topics. If you have any questions about how to write a badge query, or have one to share, please start a new topic in the #data & reporting category and tag it with the #sql-triggered-badge tag. +1 More ideas: [Some common badge queries](https://meta.discourse.org/t/some-common-badge-queries-idea/31859)

此外，您可能还需要使用像 [Discourse Automation](https://meta.discourse.org/t/discourse-automation/195773) 或 [Data Explorer](https://meta.discourse.org/t/data-explorer-plugin/32566) 这样的插件，来将徽章与一个结果操作连接起来，无论是自动还是手动。

在这方面，您也可以跳过徽章，直接使用 [Data Explorer](https://meta.discourse.org/t/32566?silent=true) 的定期 SQL 查询，手动授予符合查询条件的用户免费会员资格。

---

_[View the full topic](https://meta.discourse.org/t/exclude-certain-categories-from-the-trust-levels/222513)._
