From 9fc910f10fa48ab88250300a83ff8cc89c6b47ed Mon Sep 17 00:00:00 2001 From: whwyy Date: Tue, 30 Jun 2026 23:11:55 +0800 Subject: [PATCH] eee --- SqlBuilder.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/SqlBuilder.php b/SqlBuilder.php index 32190f3..0ae3d5b 100644 --- a/SqlBuilder.php +++ b/SqlBuilder.php @@ -281,10 +281,11 @@ class SqlBuilder extends Component */ private function make(): string { - $select = $this->makeCondition(); - $select .= $this->makeGroup(); - $select .= $this->makeOrder(); - return $select; + return join(' ', [ + $this->makeCondition(), + $this->makeGroup(), + $this->makeOrder(), + ]); } /** @@ -310,7 +311,7 @@ class SqlBuilder extends Component private function makeGroup(): string { if ($this->query->group !== '' && $this->query->group !== '0') { - return ' GROUP BY ' . $this->query->group; + return 'GROUP BY ' . $this->query->group; } return ''; } @@ -322,7 +323,7 @@ class SqlBuilder extends Component private function makeOrder(): string { if (count($this->query->order) > 0) { - return ' ORDER BY ' . implode(',', $this->query->order); + return 'ORDER BY ' . implode(',', $this->query->order); } return ''; } @@ -337,7 +338,7 @@ class SqlBuilder extends Component if (empty($condition)) { return ''; } - return ' WHERE ' . $condition; + return 'WHERE ' . $condition; }