diff --git a/source/application/common/dm/Dm.php b/source/application/common/dm/Dm.php index 5f598b1..9373b9d 100644 --- a/source/application/common/dm/Dm.php +++ b/source/application/common/dm/Dm.php @@ -134,15 +134,19 @@ class Dm * @param string $fields // 查询字段 * @param string $order // 查询排序 * @param string $limit // 查询条数 + * @param string $group // 查询分组 * @return array // 返回数组 */ - public function select($table, $where = null, $fields = '*', $order = null, $limit = null) + public function select($table, $where = null, $fields = '*', $order = null, $limit = null, $group = null) { $tableName = $this->splitTableName($table); $sql = 'SELECT '.$fields.' FROM '.$tableName; if ($where != null) { $sql .= ' WHERE '.$where; } + if ($group != null) { + $sql .= ' GROUP BY '.$group; + } if ($order != null) { $sql .= ' ORDER BY '.$order; }