From f75f91bfe07c8f9fd4e6ebb8c97faebbfd622efa Mon Sep 17 00:00:00 2001 From: TossPig Date: Sun, 23 Nov 2014 17:59:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9IsDeleted=E7=9A=84=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在pqsql下测试通过 --- session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session.go b/session.go index 7b4e6690..e5ec7fd0 100644 --- a/session.go +++ b/session.go @@ -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)) } } }