fix: miss join type (#6056)

This commit is contained in:
Cr 2023-02-18 09:13:36 +08:00 committed by GitHub
parent 532e9cf4cc
commit aa89736db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -253,7 +253,10 @@ func joins(db *DB, joinType clause.JoinType, query string, args ...interface{})
if len(args) == 1 { if len(args) == 1 {
if db, ok := args[0].(*DB); ok { if db, ok := args[0].(*DB); ok {
j := join{Name: query, Conds: args, Selects: db.Statement.Selects, Omits: db.Statement.Omits} j := join{
Name: query, Conds: args, Selects: db.Statement.Selects,
Omits: db.Statement.Omits, JoinType: joinType,
}
if where, ok := db.Statement.Clauses["WHERE"].Expression.(clause.Where); ok { if where, ok := db.Statement.Clauses["WHERE"].Expression.(clause.Where); ok {
j.On = &where j.On = &where
} }