增加 database.auto_timestamp 配置参数用于配置是否需要自动写入时间戳字段

This commit is contained in:
thinkphp
2016-05-23 11:47:33 +08:00
parent 80e87d1d79
commit 6172303c97
4 changed files with 42 additions and 21 deletions

View File

@@ -99,6 +99,8 @@ abstract class Connection
'fields_strict' => true,
// 数据集返回类型
'resultset_type' => Db::RESULTSET_ARRAY,
// 自动写入时间戳字段
'auto_timestamp' => false,
];
// PDO连接参数
@@ -212,9 +214,9 @@ abstract class Connection
* @param string $config 配置名称
* @return mixed
*/
public function getConfig($config)
public function getConfig($config = '')
{
return $this->config[$config];
return $config ? $this->config[$config] : $this->config;
}
/**