From 80a010680c7408551a79e39db11e3118a08f8e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Sun, 28 Jul 2024 00:58:30 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E6=B8=85=E7=90=86?= =?UTF-8?q?=E4=B8=8D=E6=B4=BB=E8=B7=83=E6=88=90=E5=91=98=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E4=BC=9A=E6=8A=8A=E6=9C=BA=E5=99=A8=E4=BA=BA=E6=B8=85?= =?UTF-8?q?=E7=90=86=E6=8E=89=E7=9A=84=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/cleargroupuser/cleargroupuser.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/cleargroupuser/cleargroupuser.go b/tasks/cleargroupuser/cleargroupuser.go index 306faef..98f3b70 100644 --- a/tasks/cleargroupuser/cleargroupuser.go +++ b/tasks/cleargroupuser/cleargroupuser.go @@ -57,10 +57,11 @@ func ClearGroupUser() { // @param days 需要清理的未活跃的天数 // @return members func getNeedDeleteMembers(groupId string, days int) (members []entity.GroupUser) { - err := client.MySQL.Model(&entity.GroupUser{}).Where("group_id = ?", groupId). + err := client.MySQL.Model(&entity.GroupUser{}). + Where("group_id = ?", groupId). + Where("wxid != ?", current.GetRobotInfo().WxId). Where("is_member IS TRUE"). Where("DATEDIFF( NOW(), last_active ) >= ?", days). - Where("wxid != ?", current.GetRobotInfo().WxId). Order("last_active DESC"). Find(&members).Error if err != nil {