查询带宽统计时,自动调整开始和结束日期顺序

This commit is contained in:
GoEdgeLab
2022-10-04 08:55:03 +08:00
parent 797fa4251c
commit 9ea5b3f87a
2 changed files with 8 additions and 0 deletions

View File

@@ -396,6 +396,10 @@ func (this *ServerBandwidthStatDAO) FindMonthlyPercentile(tx *dbs.Tx, serverId i
// FindPercentileBetweenDays 获取日期段内内百分位
func (this *ServerBandwidthStatDAO) FindPercentileBetweenDays(tx *dbs.Tx, serverId int64, dayFrom string, dayTo string, percentile int32) (result *ServerBandwidthStat, err error) {
if dayFrom > dayTo {
dayFrom, dayTo = dayTo, dayFrom
}
if percentile <= 0 {
percentile = 95
}