From 641e47d233cfd2d6318c0389d6bbb981189e2ab0 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 28 Dec 2015 19:10:58 +0800 Subject: [PATCH] =?UTF-8?q?model=E7=B1=BB=E4=B8=80=E5=A4=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=AE=80=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/model.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/library/think/model.php b/library/think/model.php index 88ee896e..afeb7fc4 100644 --- a/library/think/model.php +++ b/library/think/model.php @@ -72,11 +72,7 @@ class Model list($this->dbName, $this->name) = explode('.', $this->name); } - if (!empty($config['prefix'])) { - $this->tablePrefix = $config['prefix']; - } else { - $this->tablePrefix = Config::get('database.prefix'); - } + $this->tablePrefix = !empty($config['prefix']) ? $config['prefix'] : Config::get('database.prefix'); if (!empty($config['connection'])) { $this->connection = $config['connection']; }