修复gdb.Count链式操作问题

This commit is contained in:
john
2018-08-07 13:18:13 +08:00
parent 819b7def79
commit 83016d92ea
2 changed files with 17 additions and 17 deletions

View File

@ -347,7 +347,7 @@ func (md *Model) Count() (int, error) {
}
if len(list) > 0 {
for _, v := range list[0] {
return gconv.Int(v), nil
return v.Int(), nil
}
}
return 0, nil

View File

@ -12,23 +12,23 @@ import (
)
func (v Value) Bytes() []byte { return []byte(v) }
func (v Value) String() string { return string(v) }
func (v Value) Bool() bool { return gconv.Bool(v) }
func (v Value) String() string { return string(v.Bytes()) }
func (v Value) Bool() bool { return gconv.Bool(v.Bytes()) }
func (v Value) Int() int { return gconv.Int(v) }
func (v Value) Int8() int8 { return gconv.Int8(v) }
func (v Value) Int16() int16 { return gconv.Int16(v) }
func (v Value) Int32() int32 { return gconv.Int32(v) }
func (v Value) Int64() int64 { return gconv.Int64(v) }
func (v Value) Int() int { return gconv.Int(v.Bytes()) }
func (v Value) Int8() int8 { return gconv.Int8(v.Bytes()) }
func (v Value) Int16() int16 { return gconv.Int16(v.Bytes()) }
func (v Value) Int32() int32 { return gconv.Int32(v.Bytes()) }
func (v Value) Int64() int64 { return gconv.Int64(v.Bytes()) }
func (v Value) Uint() uint { return gconv.Uint(v) }
func (v Value) Uint8() uint8 { return gconv.Uint8(v) }
func (v Value) Uint16() uint16 { return gconv.Uint16(v) }
func (v Value) Uint32() uint32 { return gconv.Uint32(v) }
func (v Value) Uint64() uint64 { return gconv.Uint64(v) }
func (v Value) Uint() uint { return gconv.Uint(v.Bytes()) }
func (v Value) Uint8() uint8 { return gconv.Uint8(v.Bytes()) }
func (v Value) Uint16() uint16 { return gconv.Uint16(v.Bytes()) }
func (v Value) Uint32() uint32 { return gconv.Uint32(v.Bytes()) }
func (v Value) Uint64() uint64 { return gconv.Uint64(v.Bytes()) }
func (v Value) Float32() float32 { return gconv.Float32(v) }
func (v Value) Float64() float64 { return gconv.Float64(v) }
func (v Value) Float32() float32 { return gconv.Float32(v.Bytes()) }
func (v Value) Float64() float64 { return gconv.Float64(v.Bytes()) }
func (v Value) Time(format...string) time.Time { return gconv.Time(v, format...) }
func (v Value) TimeDuration() time.Duration { return gconv.TimeDuration(v) }
func (v Value) Time(format...string) time.Time { return gconv.Time(v.Bytes(), format...) }
func (v Value) TimeDuration() time.Duration { return gconv.TimeDuration(v.Bytes()) }