mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
增加db_attr_case配置参数 用于配置 数据表字段大小写规则
This commit is contained in:
@@ -155,6 +155,7 @@ return [
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
'db_fields_strict' => true,
|
'db_fields_strict' => true,
|
||||||
|
'db_attr_case' => \PDO::CASE_LOWER,
|
||||||
'database' => [
|
'database' => [
|
||||||
// 数据库类型
|
// 数据库类型
|
||||||
'type' => 'mysql',
|
'type' => 'mysql',
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Model
|
|||||||
// 数据库名称
|
// 数据库名称
|
||||||
protected $dbName = '';
|
protected $dbName = '';
|
||||||
// 数据表字段大小写
|
// 数据表字段大小写
|
||||||
protected $attrCase = \PDO::CASE_LOWER;
|
protected $attrCase = null;
|
||||||
//数据库配置
|
//数据库配置
|
||||||
protected $connection = [];
|
protected $connection = [];
|
||||||
// 数据表名(不包含表前缀)
|
// 数据表名(不包含表前缀)
|
||||||
@@ -98,8 +98,8 @@ class Model
|
|||||||
$this->dbName = $config['db_name'];
|
$this->dbName = $config['db_name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['attr_case'])) {
|
if (is_null($this->attrCase)) {
|
||||||
$this->attrCase = $config['attr_case'];
|
$this->attrCase = Config::get('db_attr_case');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 数据库初始化操作
|
// 数据库初始化操作
|
||||||
|
|||||||
Reference in New Issue
Block a user