mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进
This commit is contained in:
@@ -36,7 +36,7 @@ class Db
|
||||
// 解析连接参数 支持数组和字符串
|
||||
$options = self::parseConfig($config);
|
||||
// 如果采用lite方式 仅支持原生SQL 包括query和execute方法
|
||||
$class = $lite ? 'think\\db\\lite' : 'think\\db\\driver\\' . strtolower($options['type']);
|
||||
$class = $lite ? '\\think\\db\\Lite' : '\\think\\db\\driver\\' . ucwords($options['type']);
|
||||
self::$instance[$md5] = new $class($options);
|
||||
}
|
||||
self::$_instance = self::$instance[$md5];
|
||||
|
||||
@@ -437,13 +437,11 @@ class Lite
|
||||
*/
|
||||
protected function initConnect($master = true)
|
||||
{
|
||||
if (!empty($this->config['deploy']))
|
||||
if (!empty($this->config['deploy'])) {
|
||||
// 采用分布式数据库
|
||||
{
|
||||
$this->_linkID = $this->multiConnect($master);
|
||||
} else
|
||||
} elseif (!$this->_linkID) {
|
||||
// 默认单数据库
|
||||
if (!$this->_linkID) {
|
||||
$this->_linkID = $this->connect();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user