diff --git a/session.go b/session.go index a3f9f0da..71449bbd 100644 --- a/session.go +++ b/session.go @@ -2058,11 +2058,19 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error if col.MapType == core.ONLYFROMDB { continue } + if col.IsDeleted { + continue + } if session.Statement.ColumnStr != "" { if _, ok := session.Statement.columnMap[col.Name]; !ok { continue } } + if session.Statement.OmitStr != "" { + if _, ok := session.Statement.columnMap[col.Name]; ok { + continue + } + } if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime { args = append(args, session.Engine.NowTime(col.SQLType.Name)) } else { @@ -2086,11 +2094,19 @@ func (session *Session) innerInsertMulti(rowsSlicePtr interface{}) (int64, error if col.MapType == core.ONLYFROMDB { continue } + if col.IsDeleted { + continue + } if session.Statement.ColumnStr != "" { if _, ok := session.Statement.columnMap[col.Name]; !ok { continue } } + if session.Statement.OmitStr != "" { + if _, ok := session.Statement.columnMap[col.Name]; ok { + continue + } + } if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime { args = append(args, session.Engine.NowTime(col.SQLType.Name)) } else {