public async Task <ReturnPagin <List <ReturnSalaryDto> > > QueryPaginAsync(SelectSalaryDto model) { var result = new ReturnPagin <List <ReturnSalaryDto> >(); var salarys = _context.Salarys.Include(i => i.StaffInfo).AsNoTracking(); result.Items = await salarys.OrderByDescending(i => i.CreateTime).Pagin(model).Select(i => new ReturnSalaryDto { Id = i.Id, StaffInfoName = i.StaffInfo.Name, BasicSalary = i.BasicSalary, Deduction = i.Deduction, CreateTime = i.LastUpTime, MealSubsidy = i.MealSubsidy, OtherSubsidies = i.OtherSubsidies, Reward = i.Reward, TransportationSubsidy = i.TransportationSubsidy, }).ToListAsync(); result.Count = await salarys.CountAsync(); result.Number = model.Number; result.Page = model.Page; return(result); }
public async Task <IActionResult> QueryPaginAsync(SelectSalaryDto model) { var result = await _service.QueryPaginAsync(model); return(Ok(result)); }