From 002cd48d5478127c0a178bda1fe2044a29ac36be Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 6 Feb 2017 14:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E8=BD=AF=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/traits/model/SoftDelete.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/traits/model/SoftDelete.php b/library/traits/model/SoftDelete.php index 8781544f..720b6e88 100644 --- a/library/traits/model/SoftDelete.php +++ b/library/traits/model/SoftDelete.php @@ -42,7 +42,7 @@ trait SoftDelete { $model = new static(); $field = $model->getDeleteTimeField(true); - return $model->db(false)->where($field, 'exp', 'is not null'); + return $model->db(false)->whereNotNull($field); } /** @@ -129,7 +129,7 @@ trait SoftDelete protected function base($query) { $field = $this->getDeleteTimeField(true); - $query->where($field, 'null'); + $query->whereNull($field); } /**