mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-08-30 12:45:32 +08:00
完善数据库类
This commit is contained in:
@@ -63,6 +63,7 @@ abstract class Connection
|
||||
'password' => '',
|
||||
// 端口
|
||||
'hostport' => '',
|
||||
// 连接dsn
|
||||
'dsn' => '',
|
||||
// 数据库连接参数
|
||||
'params' => [],
|
||||
@@ -80,8 +81,6 @@ abstract class Connection
|
||||
'master_num' => 1,
|
||||
// 指定从服务器序号
|
||||
'slave_no' => '',
|
||||
// like字段自动替换为%%包裹
|
||||
'like_fields' => '',
|
||||
// 是否严格检查字段是否存在
|
||||
'fields_strict' => true,
|
||||
];
|
||||
@@ -123,6 +122,18 @@ abstract class Connection
|
||||
return call_user_func_array([$this->query, $method], $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前name
|
||||
* @access public
|
||||
* @param string $name
|
||||
* @return $this
|
||||
*/
|
||||
public function name($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定当前数据表
|
||||
* @param string $table 数据表名称
|
||||
@@ -150,18 +161,6 @@ abstract class Connection
|
||||
return $tableName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前name
|
||||
* @access public
|
||||
* @param string $name
|
||||
* @return $this
|
||||
*/
|
||||
public function name($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据库的配置参数
|
||||
* @access public
|
||||
|
||||
Reference in New Issue
Block a user