# 徽章上的“授予者”未显示员工姓名

**URL:** <https://meta.discourse.org/t/granted-by-on-badges-not-displaying-the-staff-name/282286>\
**Category:** Bug\
**Tags:** badges\
**Created:** [2023 年10 月 15 日 18:00 UTC](https://meta.discourse.org/t/granted-by-on-badges-not-displaying-the-staff-name/282286 "2023-10-15T18:00:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

作者： ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)\
发布日期： [2023 年10 月 16 日 04:13 UTC](https://meta.discourse.org/t/granted-by-on-badges-not-displaying-the-staff-name/282286/4 "2023-10-16T04:13:53Z")

</div>

我认为此提交可能相关 🤔 不幸的是，关于它的元主题讨论已不再可用。

> <https://github.com/discourse/discourse/pull/6266>
>
> \> DISCUSSION: https://meta.discourse.org/t/trouble-accessing-preferences-after-u…pgrade-to-discourse-2-1-0-beta4/94253/2?u=xrav3nz
> 
> \`UserSerializer\` is making tons of SQL queries on the fly when serializing \`user\_badge.granted\_by\`. Using \`UserBadgeSerializer::UserSerializer\` cuts down the number of queries from 81 to 8 locally for me.
> 
> From what I can see, \`granted\_by\` is only used in:
> 
> https://github.com/discourse/discourse/blob/7f4ef3db9e1a2794083bf99f5f1f8e17b24de54c/app/assets/javascripts/admin/templates/user-badges.hbs#L42-L45
> 
> and \`UserBadgeSerializer::UserSerializer\` serializes enough information for it.

---

_[View the full topic](https://meta.discourse.org/t/granted-by-on-badges-not-displaying-the-staff-name/282286)._
