Skip to content

Commit bf2a405

Browse files
radekdostalf3l1x
authored andcommitted
Fix default sort
If the array contained more than one column for sorting, only the last one was used.
1 parent 64dbe75 commit bf2a405

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/QueryHelper.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function limit(int $limit, int $offset): string
103103

104104
public function orderBy(string $column, string $order): string
105105
{
106-
$this->query['ORDER'] = [[
106+
$this->query['ORDER'][] = [
107107
'expr_type' => 'colref',
108108
'base_expr' => $column,
109109
'no_quotes' => [
@@ -112,7 +112,7 @@ public function orderBy(string $column, string $order): string
112112
],
113113
'subtree' => false,
114114
'direction' => $order,
115-
]];
115+
];
116116

117117
return $this->sqlCreator->create($this->query);
118118
}

0 commit comments

Comments
 (0)