From 700dc44d4f810845ae302bcd2a497b2cc3c7b285 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 5 Aug 2016 18:14:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BModel=E7=9A=84=E5=BB=B6?= =?UTF-8?q?=E8=BF=9F=E5=86=99=E5=85=A5=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 15539618..ba5be118 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -565,9 +565,7 @@ class Query // 延迟写入 $guid = md5($this->getTable() . '_' . $field . '_' . serialize($condition)); $step = $this->lazyWrite('inc', $guid, $step, $lazyTime); - if (false === $step) { - return true; // 等待下次写入 - } + return false === $step ? true : $this->setField($field, $step); } return $this->setField($field, ['exp', $field . '+' . $step]); } @@ -592,10 +590,7 @@ class Query // 延迟写入 $guid = md5($this->getTable() . '_' . $field . '_' . serialize($condition)); $step = $this->lazyWrite('dec', $guid, $step, $lazyTime); - if (false === $step) { - return true; // 等待下次写入 - } - $step = -$step; + return false === $step ? true : $this->setField($field, $step); } return $this->setField($field, ['exp', $field . '-' . $step]); }