bug fixed

This commit is contained in:
Lunny Xiao 2015-02-28 16:15:12 +08:00
parent 0cfd60f101
commit 8dcef74e9a
1 changed files with 3 additions and 0 deletions

View File

@ -338,7 +338,10 @@ func genCols(table *core.Table, session *Session, bean interface{}, useCol bool,
if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime { if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime {
val, t := session.Engine.NowTime2(col.SQLType.Name) val, t := session.Engine.NowTime2(col.SQLType.Name)
args = append(args, val) args = append(args, val)
var colName = col.Name
session.afterClosures = append(session.afterClosures, func(bean interface{}) { session.afterClosures = append(session.afterClosures, func(bean interface{}) {
col := table.GetColumn(colName)
v, _ := col.ValueOf(bean) v, _ := col.ValueOf(bean)
switch v.Type().Kind() { switch v.Type().Kind() {
case reflect.Struct: case reflect.Struct: