强化日志信息 仅调试模式下有效 Input类的方法支持 判断一个变量是否存在

This commit is contained in:
thinkphp
2016-01-28 14:57:30 +08:00
parent ad0b7255e4
commit 7dec0b2f9d
15 changed files with 72 additions and 20 deletions

View File

@@ -27,13 +27,13 @@ class Model
// 主键名称
protected $pk = 'id';
// 数据表前缀
protected $tablePrefix = '';
protected $tablePrefix = null;
// 模型名称
protected $name = '';
// 数据库名称
protected $dbName = '';
//数据库配置
protected $connection = '';
protected $connection = [];
// 数据表名(不包含表前缀)
protected $tableName = '';
// 实际数据表名(包含表前缀)
@@ -74,7 +74,11 @@ class Model
list($this->dbName, $this->name) = explode('.', $this->name);
}
$this->tablePrefix = !empty($config['prefix']) ? $config['prefix'] : Config::get('database.prefix');
if (!empty($config['prefix'])) {
$this->tablePrefix = $config['prefix'];
} elseif (is_null($this->tablePrefix)) {
$this->tablePrefix = Config::get('database.prefix');
}
if (!empty($config['connection'])) {
$this->connection = $config['connection'];
}