Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ome committed Nov 27, 2015
2 parents 9578825 + dc0cbcd commit dfa6766
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Adapters/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public function getResponse() {
});

$this->bind('order', function($order) {
$this->builder->orderBy(implode(', ', $order));
if (!empty($order)) {
$this->builder->orderBy(implode(', ', $order));
}
});

$builder = new PQueryBuilder([
Expand All @@ -37,11 +39,11 @@ public function getResponse() {
]);

$filtered = $builder->getPaginate();

return $this->formResponse([
'total' => $total->total_items,
'filtered' => $filtered->total_items,
'data' => $filtered->items->toArray(),
]);
}
}
}

0 comments on commit dfa6766

Please sign in to comment.