Переглянути джерело

fix(flexcdn): 修复高防 IP 查询数量不准确的问题- 在 GetCcIpCount 函数中添加了 state = 1 的查询条件
- 确保只统计处于激活状态的 IP 数量,提高查询准确性

fusu 2 тижнів тому
батько
коміт
0f538ad106
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      internal/repository/api/flexCdn/cciplist.go

+ 1 - 1
internal/repository/api/flexCdn/cciplist.go

@@ -53,5 +53,5 @@ func (r *ccIpListRepository) GetIpId(ctx context.Context, ipListId int64,ip stri
 
 func (r *ccIpListRepository) GetCcIpCount(ctx context.Context,ipListId int64, ip string,sourceCategory string) (int64, error) {
 	var count int64
-	return count, r.DBWithName(ctx,"cdn").Table("cloud_ip_items").Where("listId = ? AND value = ? AND sourceCategory = ?", ipListId,ip,sourceCategory).Count(&count).Error
+	return count, r.DBWithName(ctx,"cdn").Table("cloud_ip_items").Where("listId = ? AND value = ? AND sourceCategory = ? AND state = 1", ipListId,ip,sourceCategory).Count(&count).Error
 }