bug fixed for joinstr when has two Join
This commit is contained in:
parent
021ad08402
commit
c039d40ada
|
@ -389,7 +389,8 @@ func (session *Session) scanMapIntoStruct(obj interface{}, objMap map[string][]b
|
|||
|
||||
for key, data := range objMap {
|
||||
if col = table.GetColumn(key); col == nil {
|
||||
session.Engine.LogWarn(fmt.Sprintf("table %v's has not column %v. %v", table.Name, key, table.Columns()))
|
||||
session.Engine.LogWarn(fmt.Sprintf("struct %v's has not field %v. %v",
|
||||
table.Type.Name(), key, table.ColumnsSeq()))
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
@ -833,7 +833,7 @@ func (statement *Statement) OrderBy(order string) *Statement {
|
|||
//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 {
|
||||
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, tablename, condition)
|
||||
} else {
|
||||
statement.JoinStr = fmt.Sprintf("%v JOIN %v ON %v", join_operator, tablename, condition)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue