Skip to content

Commit d82b9ff

Browse files
authored
Update QueryObjectDataSource.php
1 parent 0e61415 commit d82b9ff

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/QueryObjectDataSource.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,17 @@ public function sort(\Ublaboo\DataGrid\Utils\Sorting $sorting): IDataSource {
209209
} else {
210210

211211
$sort = $sorting->getSort();
212-
212+
213213
if (!empty($sort) && ($this->queryObject instanceof IQueryObject)) {
214+
$isFirst = true;
214215
foreach ($sort as $column => $order) {
215-
$this->queryObject->orderBy($column, $order);
216+
if ($isFirst) {
217+
$this->queryObject->orderBy($column, $order);
218+
}
219+
else {
220+
$this->queryObject->addOrderBy($column, $order);
221+
}
222+
$isFirst = false;
216223
}
217224
}
218225
}

0 commit comments

Comments
 (0)