From bf3797dedab64e07d171d8146249cfdd1d683f99 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 7 Dec 2016 07:41:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=97=AD=E5=8C=85=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Builder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/think/db/Builder.php b/library/think/db/Builder.php index 9c9ceb63..dd50b2b7 100644 --- a/library/think/db/Builder.php +++ b/library/think/db/Builder.php @@ -330,7 +330,9 @@ abstract class Builder } elseif (in_array($exp, ['NOT IN', 'IN'])) { // IN 查询 if ($value instanceof \Closure) { + $query = $this->query; $whereStr .= $key . ' ' . $exp . ' ' . $this->parseClosure($value); + $this->query = $query; } else { $value = is_array($value) ? $value : explode(',', $value); if (array_key_exists($field, $binds)) { @@ -376,7 +378,9 @@ abstract class Builder } elseif (in_array($exp, ['NOT EXISTS', 'EXISTS'])) { // EXISTS 查询 if ($value instanceof \Closure) { + $query = $this->query; $whereStr .= $exp . ' ' . $this->parseClosure($value); + $this->query = $query; } else { $whereStr .= $exp . ' (' . $value . ')'; }