From 879d3015cb04073069f9129a95d45dbb97d6d67e Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Sun, 23 Apr 2023 21:36:01 +0800 Subject: [PATCH] update --- internal/logic/app/group_app.go | 2 ++ internal/logic/domain/group/model/group.go | 1 + 2 files changed, 3 insertions(+) diff --git a/internal/logic/app/group_app.go b/internal/logic/app/group_app.go index adc41b7..f0d9994 100644 --- a/internal/logic/app/group_app.go +++ b/internal/logic/app/group_app.go @@ -174,6 +174,8 @@ func (*groupApp) DeleteMember(ctx context.Context, groupId int64, userId int64, if err != nil { return err } + + group.UserNum-- //群组人数减一 err = repo.GroupRepo.Save(group) if err != nil { return err diff --git a/internal/logic/domain/group/model/group.go b/internal/logic/domain/group/model/group.go index e4c5608..25d0441 100644 --- a/internal/logic/domain/group/model/group.go +++ b/internal/logic/domain/group/model/group.go @@ -93,6 +93,7 @@ func CreateGroup(userId, masterId int64, in *pb.CreateGroupReq) *Group { Extra: in.Extra, Members: make([]GroupUser, 0, len(in.MemberIds)+1), IsAllMemberBanned: 2, + UserNum: int32(len(in.MemberIds)) + 1, CreateTime: now, UpdateTime: now, }