From 508ff846c33338e14e540db4093f96b9499ceba8 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 12 Jan 2017 16:03:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88min=20max=20sum=20avg?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=9A=84=E5=8F=82=E6=95=B0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index e2c38d2f..47d53670 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -522,7 +522,7 @@ class Query * @param string $field 字段名 * @return float|int */ - public function sum($field = '*') + public function sum($field) { return $this->value('SUM(' . $field . ') AS tp_sum', 0, true); } @@ -533,7 +533,7 @@ class Query * @param string $field 字段名 * @return mixed */ - public function min($field = '*') + public function min($field) { return $this->value('MIN(' . $field . ') AS tp_min', 0, true); } @@ -544,7 +544,7 @@ class Query * @param string $field 字段名 * @return mixed */ - public function max($field = '*') + public function max($field) { return $this->value('MAX(' . $field . ') AS tp_max', 0, true); } @@ -555,7 +555,7 @@ class Query * @param string $field 字段名 * @return float|int */ - public function avg($field = '*') + public function avg($field) { return $this->value('AVG(' . $field . ') AS tp_avg', 0, true); }