diff --git a/spec/suite/Adapters/ArraySpec.php b/spec/suite/Adapters/ArraySpec.php index b8946b6..7219091 100644 --- a/spec/suite/Adapters/ArraySpec.php +++ b/spec/suite/Adapters/ArraySpec.php @@ -196,7 +196,7 @@ ], 'order' => [ [ - 'column' => 'name', + 'column' => 0, 'dir' => 'desc' ] ] @@ -224,7 +224,7 @@ ], 'order' => [ [ - 'column' => 'name', + 'column' => 0, 'dir' => 'asc' ] ] diff --git a/spec/suite/Adapters/QueryBuilderSpec.php b/spec/suite/Adapters/QueryBuilderSpec.php index 0359dad..5adcc84 100644 --- a/spec/suite/Adapters/QueryBuilderSpec.php +++ b/spec/suite/Adapters/QueryBuilderSpec.php @@ -196,7 +196,7 @@ ], 'order' => [ [ - 'column' => 'name', + 'column' => 0, 'dir' => 'desc' ] ] @@ -224,7 +224,7 @@ ], 'order' => [ [ - 'column' => 'name', + 'column' => 0, 'dir' => 'asc' ] ] diff --git a/spec/suite/Adapters/ResultSetSpec.php b/spec/suite/Adapters/ResultSetSpec.php index 8ddf9e2..9b2fa81 100644 --- a/spec/suite/Adapters/ResultSetSpec.php +++ b/spec/suite/Adapters/ResultSetSpec.php @@ -199,7 +199,7 @@ ], 'order' => [ [ - 'column' => 'name', + 'column' => 0, 'dir' => 'desc' ] ] @@ -227,7 +227,7 @@ ], 'order' => [ [ - 'column' => 'name', + 'column' => 0, 'dir' => 'asc' ] ] diff --git a/src/Adapters/AdapterInterface.php b/src/Adapters/AdapterInterface.php index dc8958e..290f309 100644 --- a/src/Adapters/AdapterInterface.php +++ b/src/Adapters/AdapterInterface.php @@ -94,11 +94,11 @@ public function bind($case, $closure) { $orderArray = []; - foreach($order as $columnId=>$orderBy) { + foreach($order as $orderBy) { if (!isset($orderBy['dir']) || !isset($orderBy['column'])) continue; $orderDir = $orderBy['dir']; - $column = $this->parser->getColumnById($columnId); + $column = $this->parser->getColumnById($orderBy['column']); if (is_null($column) || !$this->columnExists($column)) continue; $orderArray[] = "{$column} {$orderDir}";