[fix] boolean 类型存储错误

This commit is contained in:
what 2023-07-30 16:44:50 +08:00
parent a62eba9395
commit 5ad727fb3a

View File

@ -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] == "[" {