网站看板数据中增加当日独立IP和当日流量

This commit is contained in:
GoEdgeLab
2024-04-12 18:51:42 +08:00
parent 416cf4981d
commit 3b3763d35b
5 changed files with 128 additions and 24 deletions

View File

@@ -471,6 +471,17 @@ func (this *ServerStatBoardService) ComposeServerStatBoard(ctx context.Context,
}
}
// 当日统计
{
var day = timeutil.Format("Ymd")
stat, err := models.SharedServerBandwidthStatDAO.SumDailyStat(tx, req.ServerId, 0, day, day)
if err != nil {
return nil, err
}
result.DailyCountIPs = stat.CountIPs
result.DailyTrafficBytes = stat.Bytes
}
// 带宽统计
{
var month = timeutil.Format("Ym")