diff --git a/tasks/watergroup/month.go b/tasks/watergroup/month.go index bcd99d12..e0c8e75b 100644 --- a/tasks/watergroup/month.go +++ b/tasks/watergroup/month.go @@ -68,7 +68,7 @@ func dealMonth(gid string) { log.Printf("查询群成员总数失败, 错误信息: %v", err) } // 计算活跃度 - showActivity := err != nil && groupUsers > 0 + showActivity := err == nil && groupUsers > 0 activity := "0.00" if groupUsers > 0 { activity = fmt.Sprintf("%.2f", (float64(len(records))/float64(groupUsers))*100) diff --git a/tasks/watergroup/week.go b/tasks/watergroup/week.go index 6598ca21..43c315ab 100644 --- a/tasks/watergroup/week.go +++ b/tasks/watergroup/week.go @@ -67,7 +67,7 @@ func dealWeek(gid string) { log.Printf("查询群成员总数失败, 错误信息: %v", err) } // 计算活跃度 - showActivity := err != nil && groupUsers > 0 + showActivity := err == nil && groupUsers > 0 activity := "0.00" if groupUsers > 0 { activity = fmt.Sprintf("%.2f", (float64(len(records))/float64(groupUsers))*100) diff --git a/tasks/watergroup/year.go b/tasks/watergroup/year.go index 3d07bcfa..20b8a362 100644 --- a/tasks/watergroup/year.go +++ b/tasks/watergroup/year.go @@ -67,7 +67,7 @@ func dealYear(gid string) { log.Printf("查询群成员总数失败, 错误信息: %v", err) } // 计算活跃度 - showActivity := err != nil && groupUsers > 0 + showActivity := err == nil && groupUsers > 0 activity := "0.00" if groupUsers > 0 { activity = fmt.Sprintf("%.2f", (float64(len(records))/float64(groupUsers))*100) diff --git a/tasks/watergroup/yesterday.go b/tasks/watergroup/yesterday.go index 697f721b..ab01626e 100644 --- a/tasks/watergroup/yesterday.go +++ b/tasks/watergroup/yesterday.go @@ -69,7 +69,7 @@ func dealYesterday(gid string) { log.Printf("查询群成员总数失败, 错误信息: %v", err) } // 计算活跃度 - showActivity := err != nil && groupUsers > 0 + showActivity := err == nil && groupUsers > 0 activity := "0.00" if groupUsers > 0 { activity = fmt.Sprintf("%.2f", (float64(len(records))/float64(groupUsers))*100)