From 1487ee6eacfe362582566aaf2a2dd302096f198f Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 16 Apr 2016 16:56:42 +0800 Subject: [PATCH] =?UTF-8?q?query=E7=B1=BB=E6=9F=A5=E8=AF=A2=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=94=AF=E6=8C=81=E9=97=AD=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index eb4021f3..9826c08d 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1051,6 +1051,8 @@ class Query { if ($data instanceof Query) { return $data->select(); + } elseif ($data instanceof \Closure) { + call_user_func_array($data, [ & $this]); } // 分析查询表达式 $options = $this->parseExpress(); @@ -1123,6 +1125,8 @@ class Query { if ($data instanceof Query) { return $data->find(); + } elseif ($data instanceof \Closure) { + call_user_func_array($data, [ & $this]); } // 分析查询表达式 $options = $this->parseExpress();