|
@@ -208,10 +208,10 @@ func (*groupApp) SetGroupMemberBanned(ctx context.Context, optId, groupId int64, |
|
|
|
|
|
|
|
|
//2、更新 `group_user` 的 status 状态 |
|
|
//2、更新 `group_user` 的 status 状态 |
|
|
if len(userIds) == 0 { |
|
|
if len(userIds) == 0 { |
|
|
db.DB.Model(model.GroupUser{}).Where("group_id = ?", groupId).Updates(model.GroupUser{Status: sql.NullInt32{Int32: int32(pb.GroupUserStatusType_GROUP_USER_STATUS_NORMAL), Valid: true}}) |
|
|
|
|
|
|
|
|
db.DB.Model(model.GroupUser{}).Where("group_id = ?", groupId).Updates(model.GroupUserV2{Status: sql.NullInt32{Int32: int32(pb.GroupUserStatusType_GROUP_USER_STATUS_NORMAL), Valid: true}}) |
|
|
} else { |
|
|
} else { |
|
|
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}}) |
|
|
|
|
|
|
|
|
db.DB.Model(model.GroupUser{}).Where("user_id in (?) and group_id = ?", userIds, groupId).Updates(model.GroupUserV2{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.GroupUserV2{Status: sql.NullInt32{Int32: int32(pb.GroupUserStatusType_GROUP_USER_STATUS_NORMAL), Valid: true}}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//3、发送推送消息 |
|
|
//3、发送推送消息 |
|
|