# 团体订单用于装饰

**URL:** https://meta.discourse.org/t/group-order-for-flairs/328653
**Category:** Support
**Created:** [2024年九月30日 09:04 UTC](https://meta.discourse.org/t/group-order-for-flairs/328653 "2024-09-30T09:04:19Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ludwikc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ludwikc/32/438823_2.png) [@ludwikc](https://meta.discourse.org/u/ludwikc)
#### Post date: [2024年九月30日 09:04 UTC](https://meta.discourse.org/t/group-order-for-flairs/328653/1 "2024-09-30T09:04:19Z")

</div>

我在 Discourse 中有多个用户组。如何定义用户组的“顺序或优先顺序”？

用例：

我的课程中有用户（他们会获得徽章 A），还有一小部分核心成员（他们会获得徽章 B）。

所有核心成员也是我课程的成员。

由于成为核心成员更具“声望”，因此我希望他们显示徽章 B，而不是徽章 A。

如何配置？

---

<div class="post-metadata">

### Author: ![traceymoko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/traceymoko/32/483235_2.png) [@traceymoko](https://meta.discourse.org/u/traceymoko)
#### Post date: [2024年九月30日 10:45 UTC](https://meta.discourse.org/t/group-order-for-flairs/328653/2 "2024-09-30T10:45:00Z")

</div>

我认为您可以为 B 组启用“设为主组”，这样 B 徽章就会获得优先权。

`自动设为主组`

 ![该图像显示了一个用户界面，其中“信任级别自动授予成员”陈述旁边有一个复选框。（由 AI 标注）](https://global.discourse-cdn.com/meta/original/4X/3/8/9/389be5485d2f5c4b13620bbcf2b7ac6dda8eb601.png)

---

<div class="post-metadata">

### Author: ![ludwikc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ludwikc/32/438823_2.png) [@ludwikc](https://meta.discourse.org/u/ludwikc)
#### Post date: [2024年九月30日 15:25 UTC](https://meta.discourse.org/t/group-order-for-flairs/328653/3 "2024-09-30T15:25:07Z")

</div>

我试过了，但对我不起作用。这在历史上是否有效？也就是说，它是否对所有已经是两个组成员的用户都有效？

另外，有没有可能不止两个组，而是三个组？这确实是我的实际用例，因为除了课程成员（Flair A）和核心圈成员（Flair B）之外，我还有指导客户（Flair C）。

我想知道如何正确设置。

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2024年九月30日 16:19 UTC](https://meta.discourse.org/t/group-order-for-flairs/328653/4 "2024-09-30T16:19:41Z")

</div>

您可能需要指示用户在其用户首选项中将组设置为主要。

或者，自动化也可以奏效。但是，如果尚不存在脚本，则需要一些 SQL 知识才能执行此操作。因此，您可能需要考虑赞助一个用于自动化的脚本（此插件是核心的一部分），请在 #Marketplace 中咨询。

---

<div class="post-metadata">

### Author: ![ludwikc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ludwikc/32/438823_2.png) [@ludwikc](https://meta.discourse.org/u/ludwikc)
#### Post date: [2024年十月1日 09:17 UTC](https://meta.discourse.org/t/group-order-for-flairs/328653/5 "2024-10-01T09:17:19Z")

</div>

如果它是基于 SQL 的，我很乐意自己动手——我正在学习 Discourse，但已经和 SQL 打交道了大约 20 年了。

我会继续深入研究。

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2024年十月1日 12:40 UTC](https://meta.discourse.org/t/group-order-for-flairs/328653/6 "2024-10-01T12:40:22Z")

</div>

此主题有一些相关信息

> [@Create custom Automations](https://meta.discourse.org/t/create-custom-automations/275931?u=heliosurge):
>
> information_source This is a draft, and may need some extra work. Vocabulary trigger: represents the name of the trigger, eg: user\_added\_to\_group triggerable: represents the code logic associated to a trigger, eg: triggers/user\_added\_to\_group\_.rb script: represents the name of the script, eg: send\_pms scriptable: represents the code logic associated to a script, eg: scripts/send\_pms.rb Plugin API add\_automation\_scriptable(name, &block) add\_automation\_triggerable(name, &block) Scriptable AP…
