From b052eccb269cbc2f36946ffab9e069ae7f264629 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 8 Feb 2018 15:48:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B?= 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 6c64a074..0396faca 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -2423,10 +2423,12 @@ class Query } elseif (is_array($value) && is_string($value[0]) && 'eq' == strtolower($value[0])) { $data = $value[1]; } + $prefix = $this->connection->getConfig('database') . '.'; + if (isset($data)) { - return 'think:' . $this->connection->getConfig('database') . '.' . (is_array($options['table']) ? key($options['table']) : $options['table']) . '|' . $data; + return 'think:' . $prefix . (is_array($options['table']) ? key($options['table']) : $options['table']) . '|' . $data; } else { - return md5(serialize($options) . serialize($bind)); + return md5($prefix . serialize($options) . serialize($bind)); } }