diff --git a/template/api.go.template b/template/api.go.template index 80239660..fbc85942 100644 --- a/template/api.go.template +++ b/template/api.go.template @@ -24,8 +24,13 @@ pageIndex = tools.StrToInt(err, index) {{ range .Columns -}} {{$z := .IsQuery}} - {{- if ($z) -}}data.{{.GoField}} = c.Request.FormValue("{{.JsonField}}") - {{ end -}} + {{- if ($z) -}} + {{ if eq (.GoType) "int" -}} + data.{{.GoField}}, _ = tools.StringToInt(c.Request.FormValue("{{.JsonField}}")) + {{ else -}} + data.{{.GoField}} = c.Request.FormValue("{{.JsonField}}") + {{ end }} + {{- end -}} {{end}} data.DataScope = tools.GetUserIdStr(c)