From 71d5e668d15ca487c76a363da741b47378d706dc Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 23 May 2016 18:02:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bwhere=E5=92=8Cwhereor?= =?UTF-8?q?=E9=97=AD=E5=8C=85=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Builder.php | 1 + library/think/db/Query.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/library/think/db/Builder.php b/library/think/db/Builder.php index 91485f86..cfc38ffa 100644 --- a/library/think/db/Builder.php +++ b/library/think/db/Builder.php @@ -263,6 +263,7 @@ abstract class Builder } } } + $whereStr .= empty($whereStr) ? substr(implode(' ', $str), strlen($key) + 1) : implode(' ', $str); } return $whereStr; diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 225500fb..e463320e 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -727,7 +727,7 @@ class Query protected function parseWhereExp($operator, $field, $op, $condition, $param = []) { if ($field instanceof \Closure) { - call_user_func_array($field, [ & $this]); + $this->options['where'][$operator][] = $field; return; }