mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-31 09:18:38 +00:00
Fix total level count (#308)
This commit is contained in:
parent
2aa803f69f
commit
ecdf5fa1f6
1 changed files with 5 additions and 3 deletions
|
@ -56,7 +56,11 @@ public class SlotsPage : BaseLayout
|
|||
|
||||
this.SearchValue = name.Trim();
|
||||
|
||||
this.SlotCount = await this.Database.Slots.CountAsync(p => p.Name.Contains(this.SearchValue));
|
||||
this.SlotCount = await this.Database.Slots.Include(p => p.Creator)
|
||||
.Where(p => p.Name.Contains(finalSearch.ToString()))
|
||||
.Where(p => p.Creator != null && (targetAuthor == null || string.Equals(p.Creator.Username.ToLower(), targetAuthor.ToLower())))
|
||||
.Where(p => targetGame == null || p.GameVersion == targetGame)
|
||||
.CountAsync();
|
||||
|
||||
this.PageNumber = pageNumber;
|
||||
this.PageAmount = Math.Max(1, (int)Math.Ceiling((double)this.SlotCount / ServerStatics.PageSize));
|
||||
|
@ -72,8 +76,6 @@ public class SlotsPage : BaseLayout
|
|||
.Take(ServerStatics.PageSize)
|
||||
.ToListAsync();
|
||||
|
||||
this.SlotCount = this.Slots.Count;
|
||||
|
||||
return this.Page();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue