diff --git a/db/db.go b/db/db.go index 84b6e70..2b00120 100644 --- a/db/db.go +++ b/db/db.go @@ -139,6 +139,7 @@ func (that *HoTimeDB) Row(resl *sql.Rows) []Map { return nil } for j := 0; j < len(a); j++ { + //fmt.Println(reflect.ValueOf(a[j]).Type().String() ) if a[j] != nil && reflect.ValueOf(a[j]).Type().String() == "[]uint8" { lis[strs[j]] = string(a[j].([]byte)) } else { @@ -147,12 +148,12 @@ func (that *HoTimeDB) Row(resl *sql.Rows) []Map { } //防止int被误读为float64 - jlis, e := json.Marshal(lis) - if e != nil { - that.LastErr.SetError(e) - } else { - lis.JsonToMap(string(jlis), that.LastErr) - } + //jlis, e := json.Marshal(lis) + //if e != nil { + // that.LastErr.SetError(e) + //} else { + // lis.JsonToMap(string(jlis), that.LastErr) + //} dest = append(dest, lis) diff --git a/example/admin/user.go b/example/admin/user.go index 678128e..b7e6c91 100644 --- a/example/admin/user.go +++ b/example/admin/user.go @@ -24,7 +24,7 @@ var UserCtr = Ctr{ }, "search": func(this *Context) { user := this.Db.Select(this.RouterString[1], "*") - fmt.Println(user) + fmt.Println(user, user[0].GetFloat64("age")) this.Display(0, user) }, }