Browse Source

新增数据返回接口

master
wanghongjun 3 years ago
parent
commit
b4194f0da8
  1. 6
      source/application/common/dm/Dm.php

6
source/application/common/dm/Dm.php

@ -134,15 +134,19 @@ class Dm
* @param string $fields // 查询字段 * @param string $fields // 查询字段
* @param string $order // 查询排序 * @param string $order // 查询排序
* @param string $limit // 查询条数 * @param string $limit // 查询条数
* @param string $group // 查询分组
* @return array // 返回数组 * @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); $tableName = $this->splitTableName($table);
$sql = 'SELECT '.$fields.' FROM '.$tableName; $sql = 'SELECT '.$fields.' FROM '.$tableName;
if ($where != null) { if ($where != null) {
$sql .= ' WHERE '.$where; $sql .= ' WHERE '.$where;
} }
if ($group != null) {
$sql .= ' GROUP BY '.$group;
}
if ($order != null) { if ($order != null) {
$sql .= ' ORDER BY '.$order; $sql .= ' ORDER BY '.$order;
} }

Loading…
Cancel
Save