This commit is contained in:
2026-06-30 23:11:55 +08:00
parent 0a95e722d6
commit 9fc910f10f
+8 -7
View File
@@ -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;
}