mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 07:02:47 +08:00
修正几处Notice错误
This commit is contained in:
@@ -70,7 +70,7 @@ class Mongo extends Driver
|
||||
|
||||
$host = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : '') . '/' . ($config['database'] ? "{$config['database']}" : '');
|
||||
try {
|
||||
$this->linkID[$linkNum] = new \mongoClient($host, $this->config['params']);
|
||||
$this->linkID[$linkNum] = new \mongoClient($host, !empty($this->config['params'])?$this->config['params']:array());
|
||||
} catch (\MongoConnectionException $e) {
|
||||
throw new Exception($e->getmessage());
|
||||
}
|
||||
@@ -105,7 +105,7 @@ class Mongo extends Driver
|
||||
$this->_mongo = $this->_linkID->selectDb($db);
|
||||
}
|
||||
// 当前MongoCollection对象
|
||||
if ($this->config['debug']) {
|
||||
if (!empty($this->config['debug'])) {
|
||||
$this->queryStr = $this->_dbName . '.getCollection(' . $collection . ')';
|
||||
}
|
||||
if ($this->_collectionName != $collection) {
|
||||
@@ -519,7 +519,7 @@ class Mongo extends Driver
|
||||
$this->model = $options['model'];
|
||||
$this->queryTimes++;
|
||||
$query = $this->parseWhere($options['where']);
|
||||
if ($this->config['debug']) {
|
||||
if (!empty($this->config['debug'])) {
|
||||
$this->queryStr = $this->_dbName . '.' . $this->_collectionName;
|
||||
$this->queryStr .= $query ? '.find(' . json_encode($query) . ')' : '';
|
||||
$this->queryStr .= '.count()';
|
||||
|
||||
Reference in New Issue
Block a user