From 1f2355b1bffa9646083cfbaa39c7ce208a644602 Mon Sep 17 00:00:00 2001 From: TossPig Date: Sun, 23 Nov 2014 17:58:09 +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下测试通过 --- statement.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statement.go b/statement.go index b19b2b8b..3f063140 100644 --- a/statement.go +++ b/statement.go @@ -507,7 +507,7 @@ func buildConditions(engine *Engine, table *core.Table, bean interface{}, } 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