From e6c0c096dc8ecefc61c4a3822750c43a1727f250 Mon Sep 17 00:00:00 2001
From: colly_wyx <wangyixiong_007@163.com>
Date: Wed, 09 May 2018 16:14:17 +0800
Subject: [PATCH] 修复汇总问题
---
application/core/System/Db/Mongo.php | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/application/core/System/Db/Mongo.php b/application/core/System/Db/Mongo.php
index af44e2e..b739a8c 100644
--- a/application/core/System/Db/Mongo.php
+++ b/application/core/System/Db/Mongo.php
@@ -330,6 +330,7 @@
$query = $this->_parseId($query);
// ���������������
$cursor = $col->find($query,$fields);
+
// ������
if($sort){
$cursor->sort($sort);
@@ -507,6 +508,21 @@
}
/**
+ * ������
+ * @param [type] $colName [description]
+ * @param [type] $params [description]
+ * @return [type] [description]
+ */
+ public function aggregate($colName, $params){
+ $col = $this->_getCol($colName);
+ // ������������ '_id' ������
+ //$query = $this->_parseId($query);
+ $result = $col->aggregate($params);
+
+ return $result['result'];
+ }
+
+ /**
* ���������������������������
*
* @return array
@@ -538,5 +554,6 @@
}
return $arr;
}
+
}//End Class
?>
\ No newline at end of file
--
Gitblit v1.8.0