From 7a79071d1a702b3b69a39a680fb5e2a0c94adb00 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 28 Nov 2016 22:44:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=94=AF=E6=8C=81=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=AD=97=E6=AE=B5=E5=A4=9A=E6=AC=A1=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index a46bbed4..d35be22c 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -931,11 +931,16 @@ class Query $where[$field] = ['eq', $op]; } else { $where[$field] = [$op, $condition]; + // 记录一个字段多次查询条件 + $this->options['multi'][$field][] = $where[$field]; } if (!empty($where)) { if (!isset($this->options['where'][$logic])) { $this->options['where'][$logic] = []; } + if (isset($this->options['multi'][$field]) && count($this->options['multi'][$field]) > 1) { + $where[$field] = $this->options['multi'][$field]; + } $this->options['where'][$logic] = array_merge($this->options['where'][$logic], $where); } }