diff --git a/internal/logic/app/group_app.go b/internal/logic/app/group_app.go index d92d1a7..b315561 100644 --- a/internal/logic/app/group_app.go +++ b/internal/logic/app/group_app.go @@ -199,14 +199,14 @@ func (*groupApp) SetGroupMemberBanned(ctx context.Context, optId, groupId int64, } else { //设置成员禁言 //1、更新 `group` 的 is_all_member_banned 状态 - group.IsAllMemberBanned = int32(pb.AllMemberBannedType_YES_All_Member_Banned) + group.IsAllMemberBanned = int32(pb.AllMemberBannedType_NOT_All_Member_Banned) err := repo.GroupRepo.Save(group) if err != nil { return nil, err } //2、更新 `group_user` 的 status 状态 - db.DB.Model(model.GroupUser{}).Where("group_id = ?", groupId).Where("user_id IN ?", userIds).Updates(model.GroupUser{Status: int(pb.GroupUserStatusType_GROUP_USER_STATUS_Banned)}) + db.DB.Model(model.GroupUser{}).Where("user_id in (?) and group_id = ?", userIds, groupId).Updates(model.GroupUser{Status: int(pb.GroupUserStatusType_GROUP_USER_STATUS_Banned)}) //3、发送推送消息 for _, u := range userIds {