diff --git a/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs b/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs index f11ba201..36efbad8 100644 --- a/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs +++ b/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs @@ -7793,6 +7793,18 @@ namespace BMA.EHR.Application.Repositories // result_candidate.Add(r); //} + if (period.Round != 1) + { + var insigniaIdList = await _dbContext.Set() + .Include(x => x.InsigniaType) + .Where(x => x.InsigniaType!.Name == "ชั้นสายสะพาย") + .Select(x => x.Id) + .ToListAsync(); + + + result_candidate = result_candidate.Where(x => insigniaIdList.Contains(x.RequestInsignia.Id)).ToList(); + } + return result_candidate.OrderBy(x => x.Seq).ThenBy(x => x.Gender).ThenBy(x => x.ProfileId).ToList(); } catch