From da4b98fca79cab5282d80bbb376303d818be0710 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 1 Sep 2016 13:31:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index d42b83c5..1d51cc54 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -908,7 +908,11 @@ class Query $where = $field; } elseif ($field) { // 字符串查询 - $where[$field] = ['null', '']; + if (is_numeric($field)) { + $where[] = ['exp', $field]; + } else { + $where[$field] = ['null', '']; + } } } elseif (is_array($op)) { $where[$field] = $param;