|
@@ -48,7 +48,9 @@ namespace ZhonTai.Admin.Services.Project
|
|
|
{
|
|
|
await ProjectPriceInitAsync();
|
|
|
|
|
|
- var list = await _projectConfigRepository.Select.Where(m => m.ProjectId == 0 && m.ProjectPriceId == 0 && m.Status == 1)
|
|
|
+ var list = await _projectConfigRepository.Select
|
|
|
+ .Where(m => m.ProjectId == 0 && m.ProjectPriceId == 0 && m.Status == 1)
|
|
|
+ .OrderByDescending(m=>m.EffectDate)
|
|
|
.ToListAsync(a => new
|
|
|
{
|
|
|
a.Id,
|
|
@@ -59,16 +61,15 @@ namespace ZhonTai.Admin.Services.Project
|
|
|
if (list.Count > 1)
|
|
|
{
|
|
|
DateTime dtnow = DateTime.Today;
|
|
|
- var current = list.FirstOrDefault(m => m.EffectDate <= dtnow);
|
|
|
- var next = list.FirstOrDefault(m => m.EffectDate > dtnow);
|
|
|
+ var next = list[0];
|
|
|
+ var current = list[1];
|
|
|
output.CurrentRatio = current.DrawRatio;
|
|
|
output.NextRatio = next.DrawRatio;
|
|
|
output.NextEffectDate = next.EffectDate;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- output.CurrentRatio = list[0].DrawRatio;
|
|
|
- output.NextRatio = 0;
|
|
|
+ output.CurrentRatio = list[0].DrawRatio;
|
|
|
}
|
|
|
return output;
|
|
|
}
|