From 49681016b6047d2d7f21e1e3555e8e4f703fc277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 24 Feb 2021 18:37:04 +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/Orm/Condition.php | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/Database/Orm/Condition.php b/Database/Orm/Condition.php index b4a426c9..78c8e0d2 100644 --- a/Database/Orm/Condition.php +++ b/Database/Orm/Condition.php @@ -122,14 +122,14 @@ trait Condition /** * @param $condition * @param $array - * @return array + * @return string * @throws NotFindClassException * @throws ReflectionException */ - private function _arrayMap($condition, $array): mixed + private function _arrayMap($condition, $array): string { if (!isset($condition[0])) { - return $this->_arrayHash($array, $condition); + return implode(' AND ', $this->_hashMap($condition)); } $stroppier = strtoupper($condition[0]); if (str_contains($stroppier, 'OR')) { @@ -145,19 +145,7 @@ trait Condition } else { $array[] = Snowflake::createObject(['class' => HashCondition::class, 'value' => $condition]); } - return $array; - } - - - /** - * @param $array - * @param $condition - * @return mixed - */ - private function _arrayHash($array, $condition): array - { - $array[] = implode(' AND ', $this->_hashMap($condition)); - return $array; + return implode(' AND ', $array); }