This commit is contained in:
Lunny Xiao 2014-09-07 09:18:54 +08:00
parent 954c413725
commit e09d89acb3
1 changed files with 4 additions and 2 deletions

View File

@ -905,9 +905,11 @@ func (statement *Statement) Asc(colNames ...string) *Statement {
//The join_operator should be one of INNER, LEFT OUTER, CROSS etc - this will be prepended to JOIN //The join_operator should be one of INNER, LEFT OUTER, CROSS etc - this will be prepended to JOIN
func (statement *Statement) Join(join_operator, tablename, condition string) *Statement { func (statement *Statement) Join(join_operator, tablename, condition string) *Statement {
if statement.JoinStr != "" { if statement.JoinStr != "" {
statement.JoinStr = statement.JoinStr + fmt.Sprintf(" %v JOIN %v ON %v", join_operator, tablename, condition) statement.JoinStr = statement.JoinStr + fmt.Sprintf(" %v JOIN %v ON %v", join_operator,
statement.Engine.Quote(tablename), condition)
} else { } else {
statement.JoinStr = fmt.Sprintf("%v JOIN %v ON %v", join_operator, tablename, condition) statement.JoinStr = fmt.Sprintf("%v JOIN %v ON %v", join_operator,
statement.Engine.Quote(tablename), condition)
} }
return statement return statement
} }