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']; }