Exemplo n.º 1
0
func StandingWithTeams(row MultiScanner) (*model.Standing, error) {
	var standing model.Standing
	var season model.Season
	var team model.Team
	var league model.League

	err := row.Scan(
		&standing.ID, &season.ID, &standing.Wins, &standing.Losses, &standing.Ties, &standing.Created, &standing.Modified,
		&team.ID, &league.ID, &team.Name, &team.Created, &team.Modified)

	if err != nil {
		return nil, err
	}

	standing.Season = &season
	standing.Team = &team
	standing.Team.League = &league

	return &standing, nil
}