From 6136572b6ebcd85e33046724b6ebc4eeef51ba62 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 8 May 2016 22:24:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bmodel=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/think/Model.php b/library/think/Model.php index 9636c8b1..31b7c857 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -599,7 +599,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess { $result = self::with($with)->cache($cache); if (is_array($data)) { - $result = self::db()->where($data); + $result = $result->where($data); + $data = []; } elseif ($data instanceof \Closure) { call_user_func_array($data, [ & $result]); $data = [];