From 6e72edd354f95e75e5e0cf4ba1a99315906f43ab Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 13 Mar 2017 22:46:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AF=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/traits/model/SoftDelete.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/traits/model/SoftDelete.php b/library/traits/model/SoftDelete.php index 65f52e00..c0924776 100644 --- a/library/traits/model/SoftDelete.php +++ b/library/traits/model/SoftDelete.php @@ -42,7 +42,8 @@ trait SoftDelete { $model = new static(); $field = $model->getDeleteTimeField(true); - return $model->db(false)->useSoftDelete($field, ['not null', '']); + return $model->db(false) + ->useSoftDelete($field, ['not null', '']); } /** @@ -116,7 +117,10 @@ trait SoftDelete $where[$pk] = $this->getData($pk); } // 恢复删除 - return $this->db(false)->useSoftDelete($name, ['not null', ''])->where($where)->update([$name => null]); + return $this->db(false) + ->useSoftDelete($name, ['not null', '']) + ->where($where) + ->update([$name => null]); } /**