แก้pagingสมัครสอบ
This commit is contained in:
parent
bf21d09189
commit
57a52ef866
1 changed files with 9 additions and 3 deletions
|
|
@ -675,7 +675,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<dynamic>> GetsCandidateByStatusAsync(string examId, string status, int page = 1, int pageSize = 25)
|
public async Task<dynamic> GetsCandidateByStatusAsync(string examId, string status, int page = 1, int pageSize = 25)
|
||||||
{
|
{
|
||||||
var periodExam = await _context.PeriodExams.AsQueryable()
|
var periodExam = await _context.PeriodExams.AsQueryable()
|
||||||
.Where(x => x.CheckDisability == false)
|
.Where(x => x.CheckDisability == false)
|
||||||
|
|
@ -715,6 +715,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
PositionName = x.PositionExam == null ? null : x.PositionExam.PositionName,
|
PositionName = x.PositionExam == null ? null : x.PositionExam.PositionName,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
var _candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.Where(x => x.PeriodExam == periodExam && x.RegisterDate != null && x.Status != "register" && x.Status != "rejectRegister")
|
||||||
|
.CountAsync();
|
||||||
if (candidate.Where(x => x.Status == "done").FirstOrDefault() != null)
|
if (candidate.Where(x => x.Status == "done").FirstOrDefault() != null)
|
||||||
candidate = candidate.OrderBy(x => Convert.ToInt32(x.Number)).ToList();
|
candidate = candidate.OrderBy(x => Convert.ToInt32(x.Number)).ToList();
|
||||||
// var i = 0;
|
// var i = 0;
|
||||||
|
|
@ -724,7 +727,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
// candidate[i].ProfileImg.Detail = _minioService.ImagesPath(candidate[i].ProfileImg.Id).Result;
|
// candidate[i].ProfileImg.Detail = _minioService.ImagesPath(candidate[i].ProfileImg.Id).Result;
|
||||||
// i++;
|
// i++;
|
||||||
// }
|
// }
|
||||||
return candidate;
|
return new { data = candidate, total = _candidate };
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -757,6 +760,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
PositionName = x.PositionExam == null ? null : x.PositionExam.PositionName,
|
PositionName = x.PositionExam == null ? null : x.PositionExam.PositionName,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
var _candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.Where(x => x.PeriodExam == periodExam && x.RegisterDate != null && x.Status != "register" && x.Status != "rejectRegister")
|
||||||
|
.CountAsync();
|
||||||
if (candidate.Where(x => x.Status == "done").FirstOrDefault() != null)
|
if (candidate.Where(x => x.Status == "done").FirstOrDefault() != null)
|
||||||
candidate = candidate.OrderBy(x => Convert.ToInt32(x.Number)).ToList();
|
candidate = candidate.OrderBy(x => Convert.ToInt32(x.Number)).ToList();
|
||||||
// var i = 0;
|
// var i = 0;
|
||||||
|
|
@ -766,7 +772,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
// candidate[i].ProfileImg.Detail = _minioService.ImagesPath(candidate[i].ProfileImg.Id).Result;
|
// candidate[i].ProfileImg.Detail = _minioService.ImagesPath(candidate[i].ProfileImg.Id).Result;
|
||||||
// i++;
|
// i++;
|
||||||
// }
|
// }
|
||||||
return candidate;
|
return new { data = candidate, total = _candidate };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue