From 15dd8a60d7a729ca22d086662580ba150488f9a7 Mon Sep 17 00:00:00 2001 From: chenchun <454313500@qq.com> Date: Sun, 17 Sep 2023 09:52:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=97=AE=E9=A2=98=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?easy.tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Yi.Framework.Infrastructure.csproj | 2 ++ .../Bbs/Services/Impl/AccessLogService.cs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Yi.Furion.Net6/Yi.Framework.Infrastructure/Yi.Framework.Infrastructure.csproj b/Yi.Furion.Net6/Yi.Framework.Infrastructure/Yi.Framework.Infrastructure.csproj index dee903e2..7e3ece7c 100644 --- a/Yi.Furion.Net6/Yi.Framework.Infrastructure/Yi.Framework.Infrastructure.csproj +++ b/Yi.Furion.Net6/Yi.Framework.Infrastructure/Yi.Framework.Infrastructure.csproj @@ -8,6 +8,8 @@ + + diff --git a/Yi.Furion.Net6/Yi.Furion.Application/Bbs/Services/Impl/AccessLogService.cs b/Yi.Furion.Net6/Yi.Furion.Application/Bbs/Services/Impl/AccessLogService.cs index 6ff6549a..c931c0d6 100644 --- a/Yi.Furion.Net6/Yi.Furion.Application/Bbs/Services/Impl/AccessLogService.cs +++ b/Yi.Furion.Net6/Yi.Furion.Application/Bbs/Services/Impl/AccessLogService.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -49,7 +50,8 @@ namespace Yi.Furion.Application.Bbs.Services.Impl private AccessLogDto[] WeekTimeHandler(AccessLogEntity[] data) { - data = data.Where(x => x.CreationTime.DayOfWeek == DateTime.Now.DayOfWeek).ToArray(); + data = data.Where(x=>x.CreationTime>=EasyTool.DateTimeUtil.GetFirstDayOfWeek()).OrderByDescending(x=>x.CreationTime).DistinctBy(x=>x.CreationTime.DayOfWeek).ToArray(); + Dictionary processedData = new Dictionary(); // 初始化字典,将每天的数据都设为0