fix: 修复股市问题

This commit is contained in:
chenchun
2025-03-21 15:36:22 +08:00
parent 710ad95eda
commit ff8038a616
4 changed files with 6 additions and 6 deletions

View File

@@ -96,6 +96,7 @@ namespace Yi.Framework.Stock.Application.Services
.WhereIF(input.StartTime.HasValue, p => p.RecordTime >= input.StartTime.Value)
.WhereIF(input.EndTime.HasValue, p => p.RecordTime <= input.EndTime.Value)
.WhereIF(input.PeriodType.HasValue, p => p.PeriodType == input.PeriodType.Value)
.Where(x=>x.RecordTime<=DateTime.Now)
.OrderByIF(!string.IsNullOrEmpty(input.Sorting),input.Sorting)
.OrderByIF(string.IsNullOrEmpty(input.Sorting),p=>p.RecordTime);

View File

@@ -211,6 +211,7 @@ namespace Yi.Framework.Stock.Domain.Managers
// 获取最新的价格记录
var latestPriceRecord = await _stockPriceRecordRepository._DbQueryable
.Where(p => p.StockId == stockId)
.Where(x=>x.RecordTime<=DateTime.Now)
.OrderByDescending(p => p.RecordTime)
.FirstAsync();