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

This commit is contained in:
刘祥超
2022-10-04 08:55:03 +08:00
parent 912ffa062f
commit 5d4da6cccb
2 changed files with 8 additions and 0 deletions

View File

@@ -96,6 +96,10 @@ func (this *UserBandwidthStatDAO) FindUserPeekBandwidthInMonth(tx *dbs.Tx, userI
// FindPercentileBetweenDays 获取日期段内内百分位
func (this *UserBandwidthStatDAO) FindPercentileBetweenDays(tx *dbs.Tx, userId int64, dayFrom string, dayTo string, percentile int32) (result *UserBandwidthStat, err error) {
if dayFrom > dayTo {
dayFrom, dayTo = dayTo, dayFrom
}
if percentile <= 0 {
percentile = 95
}