|
|
@@ -2,6 +2,7 @@ package app |
|
|
|
|
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"database/sql" |
|
|
|
"errors" |
|
|
|
"gim/internal/logic/domain/group/model" |
|
|
|
"gim/internal/logic/domain/group/repo" |
|
|
@@ -206,9 +207,8 @@ func (*groupApp) SetGroupMemberBanned(ctx context.Context, optId, groupId int64, |
|
|
|
} |
|
|
|
|
|
|
|
//2、更新 `group_user` 的 status 状态 |
|
|
|
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)}) |
|
|
|
db.DB.Model(model.GroupUser{}).Where("(user_id) not in (?) and group_id = ?", userIds, groupId).Updates(model.GroupUser{Status: int(pb.GroupUserStatusType_GROUP_USER_STATUS_NORMAL)}) |
|
|
|
|
|
|
|
db.DB.Model(model.GroupUser{}).Where("user_id in (?) and group_id = ?", userIds, groupId).Updates(model.GroupUser{Status: sql.NullInt32{Int32: int32(pb.GroupUserStatusType_GROUP_USER_STATUS_Banned), Valid: true}}) |
|
|
|
db.DB.Model(model.GroupUser{}).Where("(user_id) not in (?) and group_id = ?", userIds, groupId).Updates(model.GroupUser{Status: sql.NullInt32{Int32: int32(pb.GroupUserStatusType_GROUP_USER_STATUS_NORMAL), Valid: true}}) |
|
|
|
//3、发送推送消息 |
|
|
|
for _, u := range userIds { |
|
|
|
err = group.PushGroupMemberBanned(ctx, optId, u, isAllMemberBanned) |
|
|
|