feat: fix GetGroups() API bug when parentGroup is in next page (#3843)

This commit is contained in:
DacongDA
2025-05-28 18:31:52 +08:00
committed by GitHub
parent 731daf5204
commit 0ad4d82d9c
2 changed files with 6 additions and 4 deletions

View File

@ -95,12 +95,13 @@ func GetGroupsHaveChildrenMap(groups []*Group) (map[string]*Group, error) {
}
}
err := ormer.Engine.Cols("owner", "name", "parent_id", "display_name").Distinct("parent_id").In("parent_id", groupIds).Find(&groupsHaveChildren)
err := ormer.Engine.Cols("owner", "name", "parent_id", "display_name").Distinct("name").In("name", groupIds).Find(&groupsHaveChildren)
if err != nil {
return nil, err
}
for _, group := range groupsHaveChildren {
resultMap[group.ParentId] = groupMap[group.ParentId]
resultMap[group.GetId()] = group
}
return resultMap, nil
}