🐛 修复清理不活跃成员的时候会把机器人清理掉的 BUG
This commit is contained in:
parent
a50b5b3418
commit
80a010680c
@ -57,10 +57,11 @@ func ClearGroupUser() {
|
|||||||
// @param days 需要清理的未活跃的天数
|
// @param days 需要清理的未活跃的天数
|
||||||
// @return members
|
// @return members
|
||||||
func getNeedDeleteMembers(groupId string, days int) (members []entity.GroupUser) {
|
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("is_member IS TRUE").
|
||||||
Where("DATEDIFF( NOW(), last_active ) >= ?", days).
|
Where("DATEDIFF( NOW(), last_active ) >= ?", days).
|
||||||
Where("wxid != ?", current.GetRobotInfo().WxId).
|
|
||||||
Order("last_active DESC").
|
Order("last_active DESC").
|
||||||
Find(&members).Error
|
Find(&members).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user