mirror of https://github.com/go-gorm/gorm.git
Include default search attributes when query with Join, close #906
This commit is contained in:
parent
1819dda80a
commit
83002c4d5f
3
scope.go
3
scope.go
|
@ -712,6 +712,9 @@ func (scope *Scope) whereSQL() (sql string) {
|
||||||
|
|
||||||
func (scope *Scope) selectSQL() string {
|
func (scope *Scope) selectSQL() string {
|
||||||
if len(scope.Search.selects) == 0 {
|
if len(scope.Search.selects) == 0 {
|
||||||
|
if len(scope.Search.joinConditions) > 0 {
|
||||||
|
return fmt.Sprintf("%v.*", scope.QuotedTableName())
|
||||||
|
}
|
||||||
return "*"
|
return "*"
|
||||||
}
|
}
|
||||||
return scope.buildSelectQuery(scope.Search.selects)
|
return scope.buildSelectQuery(scope.Search.selects)
|
||||||
|
|
Loading…
Reference in New Issue