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