diff --git a/g/database/gdb/gdb_type_result.go b/g/database/gdb/gdb_type_result.go index 9dec2399f..d9a17838b 100644 --- a/g/database/gdb/gdb_type_result.go +++ b/g/database/gdb/gdb_type_result.go @@ -6,10 +6,6 @@ package gdb -import ( - "gitee.com/johng/gf/g/util/gconv" -) - // 将结果集转换为List类型返回,便于json处理 func (r Result) ToList() List { l := make(List, len(r)) @@ -24,7 +20,7 @@ func (r Result) ToStringMap(key string) map[string]Map { m := make(map[string]Map) for _, item := range r { if v, ok := item[key]; ok { - m[gconv.String(v)] = item.ToMap() + m[v.String()] = item.ToMap() } } return m @@ -35,7 +31,7 @@ func (r Result) ToIntMap(key string) map[int]Map { m := make(map[int]Map) for _, item := range r { if v, ok := item[key]; ok { - m[gconv.Int(v)] = item.ToMap() + m[v.Int()] = item.ToMap() } } return m @@ -46,7 +42,7 @@ func (r Result) ToUintMap(key string) map[uint]Map { m := make(map[uint]Map) for _, item := range r { if v, ok := item[key]; ok { - m[gconv.Uint(v)] = item.ToMap() + m[v.Uint()] = item.ToMap() } } return m @@ -57,7 +53,7 @@ func (r Result) ToStringRecord(key string) map[string]Record { m := make(map[string]Record) for _, item := range r { if v, ok := item[key]; ok { - m[gconv.String(v)] = item + m[v.String()] = item } } return m @@ -68,7 +64,7 @@ func (r Result) ToIntRecord(key string) map[int]Record { m := make(map[int]Record) for _, item := range r { if v, ok := item[key]; ok { - m[gconv.Int(v)] = item + m[v.Int()] = item } } return m @@ -79,7 +75,7 @@ func (r Result) ToUintRecord(key string) map[uint]Record { m := make(map[uint]Record) for _, item := range r { if v, ok := item[key]; ok { - m[gconv.Uint(v)] = item + m[v.Uint()] = item } } return m