mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
修正mongo模型不能连接及报setField方法不存在的问题
This commit is contained in:
@@ -65,7 +65,7 @@ class Mongo extends Driver
|
||||
{
|
||||
if (!isset($this->linkID[$linkNum])) {
|
||||
if (empty($config)) {
|
||||
$config = $this->config['connection'];
|
||||
$config = $this->config;
|
||||
}
|
||||
|
||||
$host = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : '') . '/' . ($config['database'] ? "{$config['database']}" : '');
|
||||
@@ -95,6 +95,8 @@ class Mongo extends Driver
|
||||
$this->initConnect($master);
|
||||
}
|
||||
|
||||
$db = $db?$db:$this->config['database'];
|
||||
|
||||
try {
|
||||
if (!empty($db)) {
|
||||
// 传人Db则切换数据库
|
||||
|
||||
Reference in New Issue
Block a user