mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 19:50:55 +00:00
commit
b86cf22fc4
@ -330,6 +330,8 @@ func (o *rawSet) QueryRow(containers ...interface{}) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
structTagMap := make(map[reflect.StructTag]map[string]string)
|
||||||
|
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
|
|
||||||
if rows.Next() {
|
if rows.Next() {
|
||||||
@ -396,7 +398,12 @@ func (o *rawSet) QueryRow(containers ...interface{}) error {
|
|||||||
recursiveSetField(f)
|
recursiveSetField(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, tags := parseStructTag(fe.Tag.Get(defaultStructTagName))
|
// thanks @Gazeboxu.
|
||||||
|
tags := structTagMap[fe.Tag]
|
||||||
|
if tags == nil {
|
||||||
|
_, tags = parseStructTag(fe.Tag.Get(defaultStructTagName))
|
||||||
|
structTagMap[fe.Tag] = tags
|
||||||
|
}
|
||||||
var col string
|
var col string
|
||||||
if col = tags["column"]; col == "" {
|
if col = tags["column"]; col == "" {
|
||||||
col = nameStrategyMap[nameStrategy](fe.Name)
|
col = nameStrategyMap[nameStrategy](fe.Name)
|
||||||
|
Loading…
Reference in New Issue
Block a user