fix invalid date when update for oracle

This commit is contained in:
chendy 2020-05-27 12:05:42 +08:00
parent 8ebcb8b557
commit e4d3310042
1 changed files with 5 additions and 1 deletions

View File

@ -206,7 +206,11 @@ func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int6
colNames = append(colNames, session.engine.Quote(table.Updated)+" = ?") colNames = append(colNames, session.engine.Quote(table.Updated)+" = ?")
col := table.UpdatedColumn() col := table.UpdatedColumn()
val, t := session.engine.nowTime(col) val, t := session.engine.nowTime(col)
if session.engine.dialect.URI().DBType == schemas.ORACLE {
args = append(args, t)
} else {
args = append(args, val) args = append(args, val)
}
var colName = col.Name var colName = col.Name
if isStruct { if isStruct {