orm: inline struct support

This commit is contained in:
miraclesu
2016-02-24 18:46:14 +08:00
parent 2b23764ee0
commit 85f55fcb41
7 changed files with 39 additions and 28 deletions

View File

@@ -32,7 +32,7 @@ func getDbAlias(name string) *alias {
func getExistPk(mi *modelInfo, ind reflect.Value) (column string, value interface{}, exist bool) {
fi := mi.fields.pk
v := ind.Field(fi.fieldIndex)
v := ind.FieldByIndex(fi.fieldIndex)
if fi.fieldType&IsPostiveIntegerField > 0 {
vu := v.Uint()
exist = vu > 0