修正M函数和Model类 支持传入空白的表前缀

例如 M('User','') 或者 Loader::table('User',['prefix'=>'']);
This commit is contained in:
thinkphp
2016-02-06 19:20:16 +08:00
parent bc6b7e353f
commit 86387bc201
2 changed files with 4 additions and 2 deletions

View File

@@ -76,6 +76,8 @@ class Model
if (!empty($config['prefix'])) {
$this->tablePrefix = $config['prefix'];
} elseif ('' === $config['prefix']) {
$this->tablePrefix = '';
} elseif (is_null($this->tablePrefix)) {
$this->tablePrefix = Config::get('database.prefix');
}