fix: 修复访问日志问题,添加easy.tools

This commit is contained in:
chenchun
2023-09-17 09:52:20 +08:00
parent 65a0a6fb92
commit 15dd8a60d7
2 changed files with 5 additions and 1 deletions

View File

@@ -8,6 +8,8 @@
<ItemGroup>
<PackageReference Include="EasyTool.Core" Version="2023.914.2-pre-230916124403" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.8.43" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.8.43" />
<PackageReference Include="Furion.Pure" Version="4.8.8.43" />

View File

@@ -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<DayOfWeek, AccessLogDto> processedData = new Dictionary<DayOfWeek, AccessLogDto>();
// 初始化字典将每天的数据都设为0