commit
7e3dce7824
|
@ -1145,7 +1145,7 @@ func (session *Session) Find(rowsSlicePtr interface{}, condiBean ...interface{})
|
||||||
// See https://github.com/go-xorm/xorm/issues/179
|
// See https://github.com/go-xorm/xorm/issues/179
|
||||||
for _, col := range table.Columns() {
|
for _, col := range table.Columns() {
|
||||||
if col.IsDeleted && !session.Statement.unscoped { // tag "deleted" is enabled
|
if col.IsDeleted && !session.Statement.unscoped { // tag "deleted" is enabled
|
||||||
session.Statement.ConditionStr = fmt.Sprintf("%v IS NULL", session.Engine.Quote(col.Name))
|
session.Statement.ConditionStr = fmt.Sprintf("(%v IS NULL or %v = '0001-01-01 00:00:00') ", session.Engine.Quote(col.Name), session.Engine.Quote(col.Name))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -507,7 +507,7 @@ func buildConditions(engine *Engine, table *core.Table, bean interface{},
|
||||||
}
|
}
|
||||||
|
|
||||||
if col.IsDeleted && !unscoped { // tag "deleted" is enabled
|
if col.IsDeleted && !unscoped { // tag "deleted" is enabled
|
||||||
colNames = append(colNames, fmt.Sprintf("%v IS NULL", engine.Quote(col.Name)))
|
colNames = append(colNames, fmt.Sprintf("(%v IS NULL or %v = '0001-01-01 00:00:00')", engine.Quote(col.Name), engine.Quote(col.Name)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldValue := *fieldValuePtr
|
fieldValue := *fieldValuePtr
|
||||||
|
|
Loading…
Reference in New Issue