Fixed owners not being able to ban/kick users from clubs.

This commit is contained in:
Master Kwoth 2017-09-24 06:55:17 +02:00
parent 1102d08188
commit 8b6bf2f269
2 changed files with 3 additions and 2 deletions

View File

@ -32,6 +32,7 @@ namespace NadekoBot.Services.Database.Repositories.Impl
.Include(x => x.Applicants)
.ThenInclude(x => x.User)
.Include(x => x.Owner)
.Include(x => x.Users)
.FirstOrDefault(x => x.Owner.UserId == userId) ??
_context.Set<DiscordUser>()
.Include(x => x.Club)

View File

@ -42,12 +42,12 @@ namespace NadekoBot.Services.Database.Repositories.Impl
{
if (!_set.Where(y => y.UserId == id).Any())
{
return _set.Count();
return _set.Count() + 1;
}
return _set.Count(x => x.TotalXp >=
_set.Where(y => y.UserId == id)
.DefaultIfEmpty()
.Sum(y => y.TotalXp)) + 1;
.Sum(y => y.TotalXp));
}
public DiscordUser[] GetUsersXpLeaderboardFor(int page)