sort data leave

This commit is contained in:
kittapath 2024-10-22 10:54:39 +07:00
parent 4bec812d25
commit 380bb5ec60
11 changed files with 12 additions and 13 deletions

View file

@ -217,10 +217,9 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
var rawData = _dbContext.Set<LeaveRequest>().AsNoTracking()
.Include(x => x.Type)
.Where(x => x.LeaveStatus != "DRAFT")
.OrderByDescending(x => x.CreatedAt.Date)
.AsQueryable();
if (year != 0)
rawData = rawData.Where(x => x.LeaveStartDate.Year == year);