From ab1fc037a5a2a5e46f905c41a05aa6a7ea1c2318 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 12 Sep 2016 22:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BModel=E7=B1=BBdestroy?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/think/Model.php b/library/think/Model.php index 98eacc8a..fa6ed492 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1067,6 +1067,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess } elseif ($data instanceof \Closure) { call_user_func_array($data, [ & $query]); $data = null; + } elseif (is_null($data)) { + return 0; } $resultSet = $query->select($data); $count = 0;