Skip to content

Commit

Permalink
feat : local ranking
Browse files Browse the repository at this point in the history
  • Loading branch information
iqeq1945 committed Nov 28, 2024
1 parent 1b4daa1 commit a61d281
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/stats/stats.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ export class StatsService {
this.prisma.user.findMany({
where: { provider: { notIn: ['manager', 'staff'] } },
orderBy: { score: 'desc' },
take: 10,
take: 7,
select: {
name: true,
score: true,
Expand All @@ -393,7 +393,7 @@ export class StatsService {
user: { provider: { notIn: ['manager', 'staff'] } },
},
orderBy: { value: 'desc' },
take: 10,
take: 7,
select: {
user: { select: { name: true, score: true } },
value: true,
Expand All @@ -405,7 +405,7 @@ export class StatsService {
user: { provider: { notIn: ['manager', 'staff'] } },
},
orderBy: { value: 'desc' },
take: 10,
take: 7,
select: {
user: { select: { name: true, score: true } },
value: true,
Expand All @@ -417,7 +417,7 @@ export class StatsService {
user: { provider: { notIn: ['manager', 'staff'] } },
},
orderBy: { value: 'desc' },
take: 10,
take: 7,
select: {
user: { select: { name: true, score: true } },
value: true,
Expand All @@ -429,7 +429,7 @@ export class StatsService {
user: { provider: { notIn: ['manager', 'staff'] } },
},
orderBy: { value: 'desc' },
take: 10,
take: 7,
select: {
user: { select: { name: true, score: true } },
value: true,
Expand All @@ -441,7 +441,7 @@ export class StatsService {
user: { provider: { notIn: ['manager', 'staff'] } },
},
orderBy: { value: 'desc' },
take: 10,
take: 7,
select: {
user: { select: { name: true, score: true } },
value: true,
Expand All @@ -453,7 +453,7 @@ export class StatsService {
user: { provider: { notIn: ['manager', 'staff'] } },
},
orderBy: { value: 'desc' },
take: 10,
take: 7,
select: {
user: { select: { name: true, score: true } },
value: true,
Expand All @@ -465,7 +465,7 @@ export class StatsService {
user: { provider: { notIn: ['manager', 'staff'] } },
},
orderBy: { value: 'desc' },
take: 10,
take: 7,
select: {
user: { select: { name: true, score: true } },
value: true,
Expand All @@ -474,11 +474,13 @@ export class StatsService {
]);

return {
userRanks: results[0],
userRanks: results[0].map((item) => {
return { user: item };
}),
wooRanks: results[1],
ineRanks: results[2],
jingRanks: results[3],
lilRancks: results[4],
lilRanks: results[4],
juRanks: results[5],
goRanks: results[6],
viRanks: results[7],
Expand Down

0 comments on commit a61d281

Please sign in to comment.