.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)
|
||||
{
|
||||
return (from orduser in _set
|
||||
group orduser by orduser.UserId into g
|
||||
orderby g.Sum(x => x.Xp) descending
|
||||
select new { UserId = g.Key, TotalXp = g.Sum(x => x.Xp) })
|
||||
return _set.GroupBy(x => x.UserId)
|
||||
.OrderByDescending(x => x.Sum(y => y.Xp))
|
||||
.Skip(page * 9)
|
||||
.Take(9)
|
||||
.AsEnumerable()
|
||||
.Select(x => (x.UserId, x.TotalXp))
|
||||
.Select(x => (x.Key, x.Sum(y => y.Xp)))
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user