mirror of
https://github.com/astaxie/beego.git
synced 2024-11-23 03:40:55 +00:00
commit
8be83fe488
@ -144,8 +144,12 @@ func (d *dbBase) collectFieldValue(mi *modelInfo, fi *fieldInfo, ind reflect.Val
|
|||||||
value = field.Interface()
|
value = field.Interface()
|
||||||
if t, ok := value.(time.Time); ok {
|
if t, ok := value.(time.Time); ok {
|
||||||
d.ins.TimeToDB(&t, tz)
|
d.ins.TimeToDB(&t, tz)
|
||||||
|
if t.IsZero() {
|
||||||
|
value = nil
|
||||||
|
} else {
|
||||||
value = t
|
value = t
|
||||||
}
|
}
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
switch {
|
switch {
|
||||||
case fi.fieldType&IsPostiveIntegerField > 0:
|
case fi.fieldType&IsPostiveIntegerField > 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user