mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-15 22:22:27 +00:00
Dont show banned users on UsersPage
This commit is contained in:
parent
1ba31fb8ed
commit
57ba3f76ff
2 changed files with 4 additions and 3 deletions
|
@ -12,7 +12,7 @@ public static class StatisticsHelper
|
||||||
|
|
||||||
public static async Task<int> SlotCount() => await database.Slots.CountAsync();
|
public static async Task<int> SlotCount() => await database.Slots.CountAsync();
|
||||||
|
|
||||||
public static async Task<int> UserCount() => await database.Users.CountAsync();
|
public static async Task<int> UserCount() => await database.Users.CountAsync(u => !u.Banned);
|
||||||
|
|
||||||
public static async Task<int> MMPicksCount() => await database.Slots.CountAsync(s => s.TeamPick);
|
public static async Task<int> MMPicksCount() => await database.Slots.CountAsync(s => s.TeamPick);
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,9 @@ public class UsersPage : BaseLayout
|
||||||
|
|
||||||
if (this.PageNumber < 0 || this.PageNumber >= this.PageAmount) return this.Redirect($"/users/{Math.Clamp(this.PageNumber, 0, this.PageAmount - 1)}");
|
if (this.PageNumber < 0 || this.PageNumber >= this.PageAmount) return this.Redirect($"/users/{Math.Clamp(this.PageNumber, 0, this.PageAmount - 1)}");
|
||||||
|
|
||||||
this.Users = await this.Database.Users.OrderByDescending
|
this.Users = await this.Database.Users.Where
|
||||||
(p => p.UserId)
|
(u => !u.Banned)
|
||||||
|
.OrderByDescending(b => b.UserId)
|
||||||
.Skip(pageNumber * ServerStatics.PageSize)
|
.Skip(pageNumber * ServerStatics.PageSize)
|
||||||
.Take(ServerStatics.PageSize)
|
.Take(ServerStatics.PageSize)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue