Merge branch 'master' of github.com:go-xorm/xorm
This commit is contained in:
commit
3ff87d6204
|
@ -481,7 +481,9 @@ func (engine *Engine) mapType(v reflect.Value) *Table {
|
|||
table := engine.newTable()
|
||||
method := v.MethodByName("TableName")
|
||||
if !method.IsValid() {
|
||||
method = v.Addr().MethodByName("TableName")
|
||||
if v.CanAddr() {
|
||||
method = v.Addr().MethodByName("TableName")
|
||||
}
|
||||
}
|
||||
if method.IsValid() {
|
||||
params := []reflect.Value{}
|
||||
|
|
|
@ -523,6 +523,9 @@ func (statement *Statement) Cols(columns ...string) *Statement {
|
|||
statement.columnMap[strings.ToLower(nc)] = true
|
||||
}
|
||||
statement.ColumnStr = statement.Engine.Quote(strings.Join(newColumns, statement.Engine.Quote(", ")))
|
||||
if strings.Contains(statement.ColumnStr, ".") {
|
||||
statement.ColumnStr = strings.Replace(statement.ColumnStr, ".", statement.Engine.Quote("."), -1)
|
||||
}
|
||||
return statement
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue