mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 计算ranking时忽略Hydro用户
This commit is contained in:
1 parent
382dd53c0c
commit
923d10fb84
4 files changed
+4
-3
No files matched your search
@@ -24,7 +24,7 @@ class DomainRankHandler extends Handler {
|
||||
@query('page', Types.PositiveInt, true)
|
||||
async get(domainId: string, page = 1) {
|
||||
const [dudocs, upcount, ucount] = await paginate(
|
||||
domain.getMultiUserInDomain(domainId).sort({ rp: -1 }),
|
||||
domain.getMultiUserInDomain(domainId, { uid: { $nin: [0, 1] } }).sort({ rp: -1 }),
|
||||
page,
|
||||
100,
|
||||
);
|
||||
|
||||
@@ -87,7 +87,7 @@ class HomeHandler extends Handler {
|
||||
|
||||
async getRanking(domainId: string, limit: number = 50) {
|
||||
if (this.user.hasPerm(PERM.PERM_VIEW_RANKING)) {
|
||||
const dudocs = await domain.getMultiUserInDomain(domainId)
|
||||
const dudocs = await domain.getMultiUserInDomain(domainId, { uid: { $nin: [0, 1] } })
|
||||
.sort({ rp: -1 }).project({ uid: 1 }).limit(limit).toArray();
|
||||
const uids = dudocs.map((dudoc) => dudoc.uid);
|
||||
this.collectUser(uids);
|
||||
|
||||
Reference in new issue
Block a user