Skip to content
This repository was archived by the owner on May 12, 2022. It is now read-only.

Commit e328bf3

Browse files
author
Nik Barham
committed
Sort + Limit wrong way round in query builder
1 parent c7a886f commit e328bf3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Automatorm/Database/QueryBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,19 +214,19 @@ public function resolve()
214214
$columns = $this->resolveCount();
215215
$join = $this->resolveJoins();
216216
$where = $this->resolveWhere();
217-
$limit = $this->resolveLimit();
218217
$sort = $this->resolveSort();
218+
$limit = $this->resolveLimit();
219219

220-
return ["SELECT $columns FROM $table{$join}{$where}{$limit}{$sort};", $this->data];
220+
return ["SELECT $columns FROM $table{$join}{$where}{$sort}{$limit};", $this->data];
221221

222222
case 'select':
223223
$columns = $this->resolveColumns();
224224
$join = $this->resolveJoins();
225225
$where = $this->resolveWhere();
226-
$limit = $this->resolveLimit();
227226
$sort = $this->resolveSort();
227+
$limit = $this->resolveLimit();
228228

229-
return ["SELECT $columns FROM $table{$join}{$where}{$limit}{$sort};", $this->data];
229+
return ["SELECT $columns FROM $table{$join}{$where}{$sort}{$limit};", $this->data];
230230

231231
case 'insert':
232232
$join = $this->resolveJoins();

0 commit comments

Comments
 (0)