fix group team unit query

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧
2026-04-02 20:01:12 -04:00
parent aae627e4e8
commit 6f76360208
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ type RepoGroupTeam struct {
func (g *RepoGroupTeam) LoadGroupUnits(ctx context.Context) error {
var err error
g.Units, err = GetUnitsByGroupID(ctx, g.GroupID)
g.Units, err = GetUnitsByGroupID(ctx, g.GroupID, g.TeamID)
return err
}
+2 -2
View File
@@ -24,8 +24,8 @@ func (g *RepoGroupUnit) Unit() unit.Unit {
return unit.Units[g.Type]
}
func GetUnitsByGroupID(ctx context.Context, groupID int64) (units []*RepoGroupUnit, err error) {
return units, db.GetEngine(ctx).Where("group_id = ?", groupID).Find(&units)
func GetUnitsByGroupID(ctx context.Context, groupID, teamID int64) (units []*RepoGroupUnit, err error) {
return units, db.GetEngine(ctx).Where("group_id = ?", groupID).And("team_id = ?", teamID).Find(&units)
}
func GetGroupUnit(ctx context.Context, groupID, teamID int64, unitType unit.Type) (unit *RepoGroupUnit, err error) {