From c98f38cab4d33a108f3eb98ff5674e207af967c1 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sat, 1 Aug 2020 14:43:38 +0800 Subject: [PATCH] =?UTF-8?q?gen=20=EF=BC=9Aupdate=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/model.go.template | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/template/model.go.template b/template/model.go.template index 92bffea2..682685cd 100644 --- a/template/model.go.template +++ b/template/model.go.template @@ -3,7 +3,10 @@ package models import ( orm "go-admin/global" "go-admin/tools" -_ "time" +{{$ii := 1}} +{{ range .Columns }} + {{- if eq .GoType "time.Time" -}}{{- if eq $ii 1 -}} "time" {{$ii = 2}}{{- end}}{{- end}} +{{- end }} ) type {{.ClassName}} struct {