.xpglb should be faster now.
This commit is contained in:
parent
f08fd3bdb1
commit
d51c28b73c
@ -65,14 +65,12 @@ namespace NadekoBot.Services.Database.Repositories.Impl
|
|||||||
|
|
||||||
public (ulong UserId, int TotalXp)[] GetUsersFor(int page)
|
public (ulong UserId, int TotalXp)[] GetUsersFor(int page)
|
||||||
{
|
{
|
||||||
return (from orduser in _set
|
return _set.GroupBy(x => x.UserId)
|
||||||
group orduser by orduser.UserId into g
|
.OrderByDescending(x => x.Sum(y => y.Xp))
|
||||||
orderby g.Sum(x => x.Xp) descending
|
|
||||||
select new { UserId = g.Key, TotalXp = g.Sum(x => x.Xp) })
|
|
||||||
.Skip(page * 9)
|
.Skip(page * 9)
|
||||||
.Take(9)
|
.Take(9)
|
||||||
.AsEnumerable()
|
.AsEnumerable()
|
||||||
.Select(x => (x.UserId, x.TotalXp))
|
.Select(x => (x.Key, x.Sum(y => y.Xp)))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user