Skip to content

Commit

Permalink
fix: scan error #709
Browse files Browse the repository at this point in the history
  • Loading branch information
calorie committed May 27, 2023
1 parent dacffd2 commit 9afb012
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion relation_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ func (j *relationJoin) m2mQuery(q *SelectQuery) *SelectQuery {
baseTable := j.BaseModel.Table()

if j.Relation.M2MTable != nil {
q = q.ColumnExpr(string(j.Relation.M2MTable.SQLAlias) + ".*")
for _, col := range j.Relation.M2MBaseFields {
q = q.ColumnExpr(string(j.Relation.M2MTable.SQLAlias) + "." + string(col.SQLName))
}
for _, col := range j.Relation.M2MJoinFields {
q = q.ColumnExpr(string(j.Relation.M2MTable.SQLAlias) + "." + string(col.SQLName))
}
}

//nolint
Expand Down

0 comments on commit 9afb012

Please sign in to comment.