forked from lxh/go-wxhelper
✨ 群消息统计新增活跃用户人均消息条数和中位数
This commit is contained in:
parent
c0c810d02e
commit
8ddc40cc01
@ -79,7 +79,7 @@ func dealMonth(gid string) {
|
||||
var medianCount int64
|
||||
for idx, v := range records {
|
||||
msgCount += v.Count
|
||||
if idx == len(records)/2 {
|
||||
if idx == (len(records)/2)-1 {
|
||||
medianCount = v.Count
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ func dealWeek(gid string) {
|
||||
var medianCount int64
|
||||
for idx, v := range records {
|
||||
msgCount += v.Count
|
||||
if idx == len(records)/2 {
|
||||
if idx == (len(records)/2)-1 {
|
||||
medianCount = v.Count
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ func dealYear(gid string) {
|
||||
var medianCount int64
|
||||
for idx, v := range records {
|
||||
msgCount += v.Count
|
||||
if idx == len(records)/2 {
|
||||
if idx == (len(records)/2)-1 {
|
||||
medianCount = v.Count
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ func dealYesterday(gid string) {
|
||||
var medianCount int64
|
||||
for idx, v := range records {
|
||||
msgCount += v.Count
|
||||
if idx == len(records)/2 {
|
||||
if idx == (len(records)/2)-1 {
|
||||
medianCount = v.Count
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user