mirror of
https://gitee.com/samwaf/SamWaf.git
synced 2026-09-01 04:47:58 +08:00
fix:analysis page bug
Closes #IATZDC
This commit is contained in:
@@ -120,9 +120,15 @@ func (receiver *WafStatService) StatHomeSumDayTopIPRangeApi(req request.WafStats
|
||||
// 通过时间获取国家级别的 攻击数 访问数
|
||||
func (receiver *WafStatService) StatAnalysisDayCountryRangeApi(req request.WafStatsAnalysisDayRangeCountryReq) []response2.WafAnalysisDayStats {
|
||||
var CountOfRange []response2.WafAnalysisDayStats
|
||||
if req.AttackType == "" {
|
||||
global.GWAF_LOCAL_STATS_DB.Model(&model.StatsIPCityDay{}).Where("day between ? and ?",
|
||||
req.StartDay, req.EndDay).Select(" country as Name ,sum(count) as Value").Group("country").Order("sum(count) desc").Scan(&CountOfRange)
|
||||
|
||||
global.GWAF_LOCAL_STATS_DB.Debug().Model(&model.StatsIPCityDay{}).Where("day between ? and ? and type = ? ",
|
||||
req.StartDay, req.EndDay, req.AttackType).Select(" country as Name ,sum(count) as Value").Group("country").Order("sum(count) desc").Scan(&CountOfRange)
|
||||
} else {
|
||||
global.GWAF_LOCAL_STATS_DB.Model(&model.StatsIPCityDay{}).Where("day between ? and ? and type = ? ",
|
||||
req.StartDay, req.EndDay, req.AttackType).Select(" country as Name ,sum(count) as Value").Group("country").Order("sum(count) desc").Scan(&CountOfRange)
|
||||
|
||||
}
|
||||
return CountOfRange
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user