From 952ceeb91f4e5d9ccbf77b66e11260502b109e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 7 Sep 2020 19:09:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/Condition/MathematicsCondition.php | 33 ++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/Database/Condition/MathematicsCondition.php b/Database/Condition/MathematicsCondition.php index b1b283ff..ec078b13 100644 --- a/Database/Condition/MathematicsCondition.php +++ b/Database/Condition/MathematicsCondition.php @@ -17,57 +17,62 @@ class MathematicsCondition extends Condition */ public function builder() { - $this->value = (float)$this->value; - return $this->{strtolower($this->type)}(); + return $this->{strtolower($this->type)}((float)$this->value); } /** + * @param $value * @return string */ - public function eq() + public function eq($value) { - return $this->column . ' = ' . $this->value; + return $this->column . ' = ' . $value; } /** + * @param $value * @return string */ - public function neq() + public function neq($value) { - return $this->column . ' <> ' . $this->value; + return $this->column . ' <> ' . $value; } /** + * @param $value * @return string */ - public function gt() + public function gt($value) { - return $this->column . ' > ' . $this->value; + return $this->column . ' > ' . $value; } /** + * @param $value * @return string */ - public function egt() + public function egt($value) { - return $this->column . ' >= ' . $this->value; + return $this->column . ' >= ' . $value; } /** + * @param $value * @return string */ - public function lt() + public function lt($value) { - return $this->column . ' < ' . $this->value; + return $this->column . ' < ' . $value; } /** + * @param $value * @return string */ - public function elt() + public function elt($value) { - return $this->column . ' <= ' . $this->value; + return $this->column . ' <= ' . $value; } }