fix: include inactive channels in negative activity filters

This commit is contained in:
Yvan
2026-11-06 01:27:32 +08:00
parent b1f14bd525
commit bf67626830
3 changed files with 77 additions and 0 deletions
+7
View File
@@ -64,6 +64,13 @@ func (f AnalyticsFilter) MatchesMetrics(row *AnalyticsRow) (bool, error) {
return true, nil
}
// Inactive channels match a negative activity filter, unless another selected
// metric explicitly requires activity.
func (f AnalyticsFilter) IncludesInactiveRows() bool {
return (f.HasRegister != nil || f.HasPay != nil) &&
(f.HasRegister == nil || !*f.HasRegister) && (f.HasPay == nil || !*f.HasPay)
}
func (r *AnalyticsRow) BusinessName() string {
if value := strings.TrimSpace(r.BindingAccount); value != "" {
return value