# \[PAID\] Allow badges to be granted in restricted categories

**URL:** <https://meta.discourse.org/t/paid-allow-badges-to-be-granted-in-restricted-categories/72768>\
**Category:** Marketplace\
**Created:** [2017 年10 月 25 日 16:10 UTC](https://meta.discourse.org/t/paid-allow-badges-to-be-granted-in-restricted-categories/72768 "2017-10-25T16:10:45Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

作者： ![Bernstein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bernstein/32/304070_2.png) [@Bernstein](https://meta.discourse.org/u/Bernstein)\
发布日期： [2017 年10 月 27 日 15:02 UTC](https://meta.discourse.org/t/paid-allow-badges-to-be-granted-in-restricted-categories/72768/4 "2017-10-27T15:02:20Z")

</div>

The current badge query looks like this:

```plaintext
SELECT P.user_id, MIN(P.created_at) granted_at, MAX(P.id) post_id 
FROM badge_posts P JOIN topics T ON T.id = P.topic_id 
WHERE T.category_id IN (SELECT id FROM categories WHERE id = 50 OR parent_category_id = 50) 
AND P.user_id >= 0 GROUP BY P.user_id HAVING COUNT(*) >= 1

```

Where users are rewarded for their first post in this category (it’s a creative writing/roleplay thing) and then I have other badges for 10, 25, 50, and 100. So it would be based on their interaction AND ability to see the category, not just their trust level (if I’m even understanding your suggestion, I admit this is all beyond my skillset as an author/publisher.)

---

_[View the full topic](https://meta.discourse.org/t/paid-allow-badges-to-be-granted-in-restricted-categories/72768)._
