|
|
@ -202,17 +202,19 @@ func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int6 |
|
|
|
table := session.statement.RefTable |
|
|
|
table := session.statement.RefTable |
|
|
|
|
|
|
|
|
|
|
|
if session.statement.UseAutoTime && table != nil && table.Updated != "" { |
|
|
|
if session.statement.UseAutoTime && table != nil && table.Updated != "" { |
|
|
|
colNames = append(colNames, session.engine.Quote(table.Updated)+" = ?") |
|
|
|
if _, ok := session.statement.columnMap[strings.ToLower(table.Updated)]; !ok { |
|
|
|
col := table.UpdatedColumn() |
|
|
|
colNames = append(colNames, session.engine.Quote(table.Updated)+" = ?") |
|
|
|
val, t := session.engine.NowTime2(col.SQLType.Name) |
|
|
|
col := table.UpdatedColumn() |
|
|
|
args = append(args, val) |
|
|
|
val, t := session.engine.NowTime2(col.SQLType.Name) |
|
|
|
|
|
|
|
args = append(args, val) |
|
|
|
var colName = col.Name |
|
|
|
|
|
|
|
if isStruct { |
|
|
|
var colName = col.Name |
|
|
|
session.afterClosures = append(session.afterClosures, func(bean interface{}) { |
|
|
|
if isStruct { |
|
|
|
col := table.GetColumn(colName) |
|
|
|
session.afterClosures = append(session.afterClosures, func(bean interface{}) { |
|
|
|
setColumnTime(bean, col, t) |
|
|
|
col := table.GetColumn(colName) |
|
|
|
}) |
|
|
|
setColumnTime(bean, col, t) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|