fix: update inbound traffic query to use case-insensitive email matching and remove redundant enable filter

This commit is contained in:
SadeghKalami 2026-05-16 05:23:49 +03:30
parent 2002b84b19
commit 07ac160518

View file

@ -2508,7 +2508,7 @@ func (s *InboundService) disableSubQuotaClients(tx *gorm.DB) (bool, int64, error
var sum struct{ Total int64 }
if err := tx.Model(xray.ClientTraffic{}).
Select("COALESCE(SUM(up + down), 0) AS total").
Where("email IN ? AND enable = ?", batch, true).
Where("LOWER(email) IN ?", batch).
Scan(&sum).Error; err != nil {
continue
}