1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-03 17:00:19 +00:00

[orm] QueryTable with nil ptr struct

This commit is contained in:
bronze1man
2013-11-24 14:26:32 +08:00
parent a0dff9148a
commit ceb4aa9e25
3 changed files with 12 additions and 3 deletions

View File

@ -274,9 +274,7 @@ func (o *orm) QueryTable(ptrStructOrTableName interface{}) (qs QuerySeter) {
qs = newQuerySet(o, mi)
}
} else {
val := reflect.ValueOf(ptrStructOrTableName)
ind := reflect.Indirect(val)
name = getFullName(ind.Type())
name = getFullName(indirectType(reflect.TypeOf(ptrStructOrTableName)))
if mi, ok := modelCache.getByFN(name); ok {
qs = newQuerySet(o, mi)
}