From 05b03752d0afbb6a2e9bb9dc5fc935d34c9036b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A8=8B?= <1787003204@qq.com> Date: Thu, 6 Jan 2022 20:07:21 +0800 Subject: [PATCH] Update common.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当表字段类型为datetime或者date并且默认为NULL时,在结构中需要设置成指针类型 --- data/view/model/common.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/view/model/common.go b/data/view/model/common.go index ba0f6a4..7467953 100755 --- a/data/view/model/common.go +++ b/data/view/model/common.go @@ -100,6 +100,9 @@ func fixNullToPorint(name string, isNull bool) string { if strings.HasPrefix(name, "float") { return "*" + name } + if strings.HasPrefix(name, "date") { + return "*" + name + } if strings.HasPrefix(name, "time") { return "*" + name }