From 0b104d2b49bf5fe5bed2e02e6080ab95c868c361 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 27 Apr 2016 16:49:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E4=B8=80=E5=A4=84=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 4 +++- library/traits/think/Instance.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 31ae15fd..bd9ffec0 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -853,7 +853,9 @@ class Query { if (empty($this->options['table'])) { $tableName = $this->connection->getConfig('prefix'); - $tableName .= Loader::parseName($this->options['name']); + if (isset($this->options['name'])) { + $tableName .= Loader::parseName($this->options['name']); + } } else { $tableName = $this->options['table']; } diff --git a/library/traits/think/Instance.php b/library/traits/think/Instance.php index 07aa45da..d85975b3 100644 --- a/library/traits/think/Instance.php +++ b/library/traits/think/Instance.php @@ -15,7 +15,10 @@ trait Instance { protected static $instance = null; - // 实例化(单例) + /** + * @param array $options + * @return static + */ public static function instance($options = []) { if (is_null(self::$instance)) {