[fix] boolean 类型存储错误
This commit is contained in:
parent
a62eba9395
commit
5ad727fb3a
@ -140,8 +140,10 @@ func (this ResField) ToValue(v any) any {
|
|||||||
case contracts.ResDataType_Decimal:
|
case contracts.ResDataType_Decimal:
|
||||||
return strings.Trim(cast.ToString(v), " ")
|
return strings.Trim(cast.ToString(v), " ")
|
||||||
case contracts.ResDataType_Boolean:
|
case contracts.ResDataType_Boolean:
|
||||||
v, _ := strconv.ParseBool(fmt.Sprintf("%v", v))
|
if v, _ := strconv.ParseBool(fmt.Sprintf("%v", v)); v {
|
||||||
return v
|
return 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
case contracts.ResDataType_Json:
|
case contracts.ResDataType_Json:
|
||||||
if v == nil {
|
if v == nil {
|
||||||
if this.Default != "" && this.Default[0:1] == "[" {
|
if this.Default != "" && this.Default[0:1] == "[" {
|
||||||
|
Loading…
Reference in New Issue
Block a user