Compare commits

..

No commits in common. "fb9a51720ebd62524c01265184842a24e7eb78d6" and "c7f1bf8f235ccfa15555a5eced8b74c53ffd165a" have entirely different histories.

View File

@ -3,7 +3,6 @@ package cleargroupuser
import (
"fmt"
"go-wechat/client"
"go-wechat/common/current"
"go-wechat/model/entity"
"go-wechat/service"
"go-wechat/utils"
@ -16,7 +15,7 @@ import (
func ClearGroupUser() {
groups, err := service.GetAllEnableClearGroup()
if err != nil {
log.Printf("获取启用了末位淘汰的群组失败, 错误信息: %v", err)
log.Printf("获取启用了聊天排行榜的群组失败, 错误信息: %v", err)
return
}
@ -57,9 +56,7 @@ 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).
Where("wxid != ?", current.GetRobotInfo().WxId).
err := client.MySQL.Model(&entity.GroupUser{}).Where("group_id = ?", groupId).
Where("is_member IS TRUE").
Where("DATEDIFF( NOW(), last_active ) >= ?", days).
Order("last_active DESC").