Skip to content

Commit 2b6a528

Browse files
committed
Fixed #2 bug;
1 parent be0450c commit 2b6a528

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

spec/suite/Adapters/ArraySpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
],
197197
'order' => [
198198
[
199-
'column' => 'name',
199+
'column' => 0,
200200
'dir' => 'desc'
201201
]
202202
]
@@ -224,7 +224,7 @@
224224
],
225225
'order' => [
226226
[
227-
'column' => 'name',
227+
'column' => 0,
228228
'dir' => 'asc'
229229
]
230230
]

spec/suite/Adapters/QueryBuilderSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
],
197197
'order' => [
198198
[
199-
'column' => 'name',
199+
'column' => 0,
200200
'dir' => 'desc'
201201
]
202202
]
@@ -224,7 +224,7 @@
224224
],
225225
'order' => [
226226
[
227-
'column' => 'name',
227+
'column' => 0,
228228
'dir' => 'asc'
229229
]
230230
]

spec/suite/Adapters/ResultSetSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
],
200200
'order' => [
201201
[
202-
'column' => 'name',
202+
'column' => 0,
203203
'dir' => 'desc'
204204
]
205205
]
@@ -227,7 +227,7 @@
227227
],
228228
'order' => [
229229
[
230-
'column' => 'name',
230+
'column' => 0,
231231
'dir' => 'asc'
232232
]
233233
]

src/Adapters/AdapterInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ public function bind($case, $closure) {
9494

9595
$orderArray = [];
9696

97-
foreach($order as $columnId=>$orderBy) {
97+
foreach($order as $orderBy) {
9898
if (!isset($orderBy['dir']) || !isset($orderBy['column'])) continue;
9999
$orderDir = $orderBy['dir'];
100100

101-
$column = $this->parser->getColumnById($columnId);
101+
$column = $this->parser->getColumnById($orderBy['column']);
102102
if (is_null($column) || !$this->columnExists($column)) continue;
103103

104104
$orderArray[] = "{$column} {$orderDir}";

0 commit comments

Comments
 (0)