From 48054a6abbe4856af04c3bf362c138169e5cf36a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 27 Apr 2018 12:16:43 +0800 Subject: [PATCH] =?UTF-8?q?jion=E6=96=B9=E6=B3=95=E7=9A=84=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E4=BC=A0=E5=85=A5Expression?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Builder.php | 4 +++- library/think/db/Query.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/library/think/db/Builder.php b/library/think/db/Builder.php index abc51c1d..d4d27a1e 100644 --- a/library/think/db/Builder.php +++ b/library/think/db/Builder.php @@ -545,7 +545,9 @@ abstract class Builder list($table, $type, $on) = $item; $condition = []; foreach ((array) $on as $val) { - if (strpos($val, '=')) { + if ($val instanceof Expression) { + $condition[] = $val->getValue(); + } elseif (strpos($val, '=')) { list($val1, $val2) = explode('=', $val, 2); $condition[] = $this->parseKey($val1, $options) . '=' . $this->parseKey($val2, $options); } else { diff --git a/library/think/db/Query.php b/library/think/db/Query.php index c833cc05..1f3ddc29 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -924,7 +924,7 @@ class Query * @access public * @param string|array $table 数据表 * @param string|array $field 查询字段 - * @param string|array $on JOIN条件 + * @param mixed $on JOIN条件 * @param string $type JOIN类型 * @return $this */