Browse Source

解决时区问题

Minho 7 years ago
parent
commit
c23cb959e8
1 changed files with 2 additions and 0 deletions
  1. 2 0
      models/document.go

+ 2 - 0
models/document.go

@@ -84,6 +84,8 @@ func (m *Document) InsertOrUpdate(cols ...string) error {
 		m.ModifyTime = time.Now().Local()
 		_, err = o.Update(m)
 	} else {
+		m.ModifyTime = time.Now().Local()
+		m.CreateTime = time.Now().Local()
 		_, err = o.Insert(m)
 		NewBook().ResetDocumentNumber(m.BookId)
 	}