Explorar o código

代码生成细节处理

yxh %!s(int64=4) %!d(string=hai) anos
pai
achega
11fc5c731f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      template/vm/go/dao.template

+ 1 - 1
template/vm/go/dao.template

@@ -9,7 +9,7 @@ package dao
 
 
 {{$hasGTime:=false}}
 {{$hasGTime:=false}}
 {{range $index, $column := .table.Columns}}
 {{range $index, $column := .table.Columns}}
-{{if eq $column.GoType "Time"}}
+{{if and (eq $column.GoType "Time") (or (eq $column.IsInsert "1") (eq $column.IsEdit "1"))}}
 {{$hasGTime = true}}
 {{$hasGTime = true}}
 {{end}}
 {{end}}
 {{end}}
 {{end}}