From 29c70b6a27560de688487911470439c20997f6e2 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 14 Dec 2017 11:16:34 +0800 Subject: [PATCH] =?UTF-8?q?max=E5=92=8Cmin=E6=96=B9=E6=B3=95=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=AC=AC=E4=BA=8C=E4=B8=AA=E5=8F=82=E6=95=B0=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E8=AE=BE=E7=BD=AE=E6=98=AF=E5=90=A6=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 0df53610..78f971cb 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -534,22 +534,24 @@ class Query * MIN查询 * @access public * @param string $field 字段名 + * @param bool $force 强制转为数字类型 * @return mixed */ - public function min($field) + public function min($field, $force = true) { - return $this->value('MIN(' . $field . ') AS tp_min', 0, true); + return $this->value('MIN(' . $field . ') AS tp_min', 0, $force); } /** * MAX查询 * @access public * @param string $field 字段名 + * @param bool $force 强制转为数字类型 * @return mixed */ - public function max($field) + public function max($field, $force = true) { - return $this->value('MAX(' . $field . ') AS tp_max', 0, true); + return $this->value('MAX(' . $field . ') AS tp_max', 0, $force); } /**