diff --git a/base/query_field.go b/base/query_field.go index 89b1d38..46829c9 100644 --- a/base/query_field.go +++ b/base/query_field.go @@ -112,7 +112,7 @@ func (this *QueryField) ToStructField(tags ...string) reflect.StructField { case contracts.QueryDataType_Bool: typ = reflect.TypeOf(true) case contracts.QueryDataType_Array: - typ = reflect.TypeOf(res_type.ResFieldByAnys{}) + typ = reflect.TypeOf([]any{}) case contracts.QueryDataType_Json: typ = reflect.TypeOf(map[string]any{}) } diff --git a/base/res_field.go b/base/res_field.go index a03a495..cf85ae6 100644 --- a/base/res_field.go +++ b/base/res_field.go @@ -111,12 +111,6 @@ func (this ResField) ToValue(v any) any { v = float64(data) case string: v = strings.Trim(string(data), " ") - case res_type.ResFieldByAnys: - if v != nil { - b, _ := json.Marshal(v) - return string(b) - } - v = []any(data) case []any, []string, []int, []float64, []float32, []int64: if v != nil { b, _ := json.Marshal(v) @@ -129,6 +123,12 @@ func (this ResField) ToValue(v any) any { return string(b) } v = data + default: + if v != nil { + b, _ := json.Marshal(v) + return string(b) + } + v = data } switch this.DataType {