parent
7826f88534
commit
ad33a0be49
|
@ -457,7 +457,9 @@ func (engine *Engine) mapType(v reflect.Value) *core.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{}
|
||||
|
|
|
@ -539,6 +539,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