fix: 修复统计近7天token消耗时角色过滤条件错误

This commit is contained in:
ccnetcore
2025-10-14 22:22:35 +08:00
parent 15713cf7fe
commit 533b87fc5b

View File

@@ -44,6 +44,7 @@ public class UsageStatisticsService : ApplicationService, IUsageStatisticsServic
// 从Message表统计近7天的token消耗
var dailyUsage = await _messageRepository._DbQueryable
.Where(x => x.UserId == userId)
.Where(x => x.Role == "assistant" || x.Role == "system")
.Where(x => x.CreationTime >= startDate && x.CreationTime < endDate.AddDays(1))
.GroupBy(x => x.CreationTime.Date)
.Select(g => new