From 1e8e169b0a4229cb5a49aa6f162d3430dd1d1e9e Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 13 Jan 2017 17:53:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bwhere=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E7=9B=B8=E5=90=8C=E5=AD=97=E6=AE=B5=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 24f5ce2a..45c66ccf 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1169,8 +1169,10 @@ class Query $this->options['multi'][$logic][$field][] = $where[$field]; } elseif (is_null($condition)) { // 字段相等查询 - $where[$field] = ['eq', $op]; - $this->options['multi'][$logic][$field][] = $where[$field]; + $where[$field] = ['eq', $op]; + if ('AND' != $logic) { + $this->options['multi'][$logic][$field][] = $where[$field]; + } } else { $where[$field] = [$op, $condition, isset($param[2]) ? $param[2] : null]; if ('exp' == strtolower($op) && isset($param[2]) && is_array($param[2])) {