mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-25 18:22:27 +00:00
parent
5df6fbbb1c
commit
b31522733c
3 changed files with 5 additions and 8 deletions
|
@ -39,8 +39,7 @@ public class PhotosPage : BaseLayout
|
|||
|
||||
if (this.PageNumber < 0 || this.PageNumber >= this.PageAmount) return this.Redirect($"/photos/{Math.Clamp(this.PageNumber, 0, this.PageAmount - 1)}");
|
||||
|
||||
this.Photos = await this.Database.Photos.Include
|
||||
(p => p.Creator)
|
||||
this.Photos = await this.Database.Photos.Include(p => p.Creator)
|
||||
.Where(p => p.Creator.Username.Contains(name) || p.PhotoSubjectCollection.Contains(name))
|
||||
.OrderByDescending(p => p.Timestamp)
|
||||
.Skip(pageNumber * ServerStatics.PageSize)
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Pages.Layouts;
|
||||
using LBPUnion.ProjectLighthouse.Types.Levels;
|
||||
using LBPUnion.ProjectLighthouse.Types.Settings;
|
||||
|
@ -37,12 +36,12 @@ public class SlotsPage : BaseLayout
|
|||
|
||||
this.SearchValue = name;
|
||||
this.PageNumber = pageNumber;
|
||||
this.PageAmount = Math.Max(1, (int) Math.Ceiling((double) this.SlotCount / ServerStatics.PageSize));
|
||||
this.PageAmount = Math.Max(1, (int)Math.Ceiling((double)this.SlotCount / ServerStatics.PageSize));
|
||||
|
||||
if (this.PageNumber < 0 || this.PageNumber >= this.PageAmount) return this.Redirect($"/slots/{Math.Clamp(this.PageNumber, 0, this.PageAmount - 1)}");
|
||||
|
||||
this.Slots = await this.Database.Slots.Where
|
||||
(p => p.Name.Contains(name))
|
||||
this.Slots = await this.Database.Slots.Include(p => p.Creator)
|
||||
.Where(p => p.Name.Contains(name))
|
||||
.OrderByDescending(p => p.FirstUploaded)
|
||||
.Skip(pageNumber * ServerStatics.PageSize)
|
||||
.Take(ServerStatics.PageSize)
|
||||
|
|
|
@ -39,8 +39,7 @@ public class UsersPage : BaseLayout
|
|||
|
||||
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.Where
|
||||
(u => !u.Banned && u.Username.Contains(name))
|
||||
this.Users = await this.Database.Users.Where(u => !u.Banned && u.Username.Contains(name))
|
||||
.OrderByDescending(b => b.UserId)
|
||||
.Skip(pageNumber * ServerStatics.PageSize)
|
||||
.Take(ServerStatics.PageSize)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue