From b4194f0da82152b01ebee5208b96b5847fe5d02a Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Fri, 14 Jul 2023 14:46:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=95=B0=E6=8D=AE=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/application/common/dm/Dm.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; }