fix(log): date is empty

This commit is contained in:
Chang lue Tsen 2025-09-03 12:34:45 -04:00
parent 73ffd0d1c7
commit f8e6cf515e
2 changed files with 6 additions and 1 deletions

View File

@ -37,6 +37,11 @@ func (l *FilterTrafficLogDetailsLogic) FilterTrafficLogDetails(req *types.Filter
}
start = day
end = day.Add(24*time.Hour - time.Nanosecond)
} else {
// query today
now := time.Now()
start = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
end = start.Add(24*time.Hour - time.Nanosecond)
}
var data []*traffic.TrafficLog
tx := l.svcCtx.DB.WithContext(l.ctx).Model(&traffic.TrafficLog{})

View File

@ -216,7 +216,7 @@ func (l *SubscribeLogic) getServers(userSub *user.Subscribe) ([]*node.Node, erro
Page: 1,
Size: 1000,
ServerId: nodeIds,
Tag: tags,
Tag: tool.RemoveDuplicateElements(tags...),
Preload: true,
})