1
0
forked from lxh/go-wxhelper

群消息统计新增活跃用户人均消息条数和中位数

This commit is contained in:
李寻欢 2024-03-13 10:02:40 +08:00
parent c0c810d02e
commit 8ddc40cc01
4 changed files with 4 additions and 4 deletions

View File

@ -79,7 +79,7 @@ func dealMonth(gid string) {
var medianCount int64 var medianCount int64
for idx, v := range records { for idx, v := range records {
msgCount += v.Count msgCount += v.Count
if idx == len(records)/2 { if idx == (len(records)/2)-1 {
medianCount = v.Count medianCount = v.Count
} }
} }

View File

@ -78,7 +78,7 @@ func dealWeek(gid string) {
var medianCount int64 var medianCount int64
for idx, v := range records { for idx, v := range records {
msgCount += v.Count msgCount += v.Count
if idx == len(records)/2 { if idx == (len(records)/2)-1 {
medianCount = v.Count medianCount = v.Count
} }
} }

View File

@ -78,7 +78,7 @@ func dealYear(gid string) {
var medianCount int64 var medianCount int64
for idx, v := range records { for idx, v := range records {
msgCount += v.Count msgCount += v.Count
if idx == len(records)/2 { if idx == (len(records)/2)-1 {
medianCount = v.Count medianCount = v.Count
} }
} }

View File

@ -80,7 +80,7 @@ func dealYesterday(gid string) {
var medianCount int64 var medianCount int64
for idx, v := range records { for idx, v := range records {
msgCount += v.Count msgCount += v.Count
if idx == len(records)/2 { if idx == (len(records)/2)-1 {
medianCount = v.Count medianCount = v.Count
} }
} }