From 533b87fc5b06f5434972e9ec0876f059464a8801 Mon Sep 17 00:00:00 2001 From: ccnetcore Date: Tue, 14 Oct 2025 22:22:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=BF=917=E5=A4=A9token=E6=B6=88=E8=80=97=E6=97=B6=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/UsageStatisticsService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/UsageStatisticsService.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/UsageStatisticsService.cs index 79287379..f73af213 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/UsageStatisticsService.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/UsageStatisticsService.cs @@ -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