Browse Source

update 群组成员数量

master
dengbiao 7 months ago
parent
commit
5a06b91a51
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      internal/logic/domain/group/repo/group_repo.go

+ 7
- 1
internal/logic/domain/group/repo/group_repo.go View File

@@ -28,7 +28,13 @@ func (*groupRepo) Get(groupId int64) (*model.Group, error) {
return nil, err
}
group.Members = members

if group.UserNum != int32(len(group.Members)) {
group.UserNum = int32(len(group.Members))
err = GroupRepo.Save(group)
if err != nil {
return nil, err
}
}
err = GroupCache.Set(group)
if err != nil {
return nil, err


Loading…
Cancel
Save