fix: 流量分组查询条件改为仅判断 max_traffic_gb > 0

This commit is contained in:
shanshanzhong 2026-03-24 01:03:29 -07:00
parent 62b8c67261
commit 95830eae8a

View File

@ -632,7 +632,7 @@ func (l *RecalculateGroupLogic) executeTrafficGrouping(tx *gorm.DB, historyId in
// 1. 获取所有设置了流量区间的节点组 // 1. 获取所有设置了流量区间的节点组
var nodeGroups []group.NodeGroup var nodeGroups []group.NodeGroup
if err := tx.Where("for_calculation = ?", true). if err := tx.Where("for_calculation = ?", true).
Where("(min_traffic_gb > 0 OR max_traffic_gb > 0)"). Where("max_traffic_gb > 0").
Find(&nodeGroups).Error; err != nil { Find(&nodeGroups).Error; err != nil {
l.Errorw("failed to query node groups", logger.Field("error", err.Error())) l.Errorw("failed to query node groups", logger.Field("error", err.Error()))
return 0, err return 0, err