diff --git a/base/res_field.go b/base/res_field.go index cf85ae6..aa3f198 100644 --- a/base/res_field.go +++ b/base/res_field.go @@ -140,8 +140,10 @@ func (this ResField) ToValue(v any) any { case contracts.ResDataType_Decimal: return strings.Trim(cast.ToString(v), " ") case contracts.ResDataType_Boolean: - v, _ := strconv.ParseBool(fmt.Sprintf("%v", v)) - return v + if v, _ := strconv.ParseBool(fmt.Sprintf("%v", v)); v { + return 1 + } + return 0 case contracts.ResDataType_Json: if v == nil { if this.Default != "" && this.Default[0:1] == "[" {