mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
Query类增加connect方法用于切换数据库
This commit is contained in:
@@ -95,6 +95,18 @@ class Query
|
||||
return $this->connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换当前的数据库连接
|
||||
* @access public
|
||||
* @param mixed $config
|
||||
* @return $this
|
||||
*/
|
||||
public function connect($config)
|
||||
{
|
||||
$this->connection = Db::connect($config);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定默认的数据表名(不含前缀)
|
||||
* @access public
|
||||
|
||||
Reference in New Issue
Block a user