From 8ddc40cc0153760ecaeebe950d593034ef377308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Wed, 13 Mar 2024 10:02:40 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E7=BE=A4=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=96=B0=E5=A2=9E=E6=B4=BB=E8=B7=83=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BA=BA=E5=9D=87=E6=B6=88=E6=81=AF=E6=9D=A1=E6=95=B0?= =?UTF-8?q?=E5=92=8C=E4=B8=AD=E4=BD=8D=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/watergroup/month.go | 2 +- tasks/watergroup/week.go | 2 +- tasks/watergroup/year.go | 2 +- tasks/watergroup/yesterday.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/watergroup/month.go b/tasks/watergroup/month.go index b8ff4a05..971df23e 100644 --- a/tasks/watergroup/month.go +++ b/tasks/watergroup/month.go @@ -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 } } diff --git a/tasks/watergroup/week.go b/tasks/watergroup/week.go index f2daa61f..b8df0c95 100644 --- a/tasks/watergroup/week.go +++ b/tasks/watergroup/week.go @@ -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 } } diff --git a/tasks/watergroup/year.go b/tasks/watergroup/year.go index d3c94b08..aba255a1 100644 --- a/tasks/watergroup/year.go +++ b/tasks/watergroup/year.go @@ -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 } } diff --git a/tasks/watergroup/yesterday.go b/tasks/watergroup/yesterday.go index 184a1e16..b932756a 100644 --- a/tasks/watergroup/yesterday.go +++ b/tasks/watergroup/yesterday.go @@ -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 } }