修改IsDeleted的状态查询

在pqsql下测试通过
This commit is contained in:
TossPig 2014-11-23 17:59:10 +08:00
parent 1f2355b1bf
commit f75f91bfe0
1 changed files with 1 additions and 1 deletions

View File

@ -1145,7 +1145,7 @@ func (session *Session) Find(rowsSlicePtr interface{}, condiBean ...interface{})
// See https://github.com/go-xorm/xorm/issues/179
for _, col := range table.Columns() {
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))
}
}
}