model类一处代码简化

This commit is contained in:
thinkphp
2015-12-28 19:10:58 +08:00
parent 7d025ba2cb
commit 641e47d233

View File

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