also order exports

pull/35/head
Ondřej Hruška 6 years ago
parent 624963b729
commit 4961430c8f
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 11
      app/Tables/BaseExporter.php

@ -127,10 +127,15 @@ abstract class BaseExporter
$count = $revision->rows()->count(); $count = $revision->rows()->count();
$start = 0; $start = 0;
while ($start < $count) { $rq = $revision->rowsData($this->columns, false);
$columns = $this->columns;
// TODO raw query to allow selecting aggregates, column subsets, etc // TODO raw query to allow selecting aggregates, column subsets, etc
$rows = $revision->rowsData($this->columns, false) if (count($columns)) $rq = $rq->orderByRaw("data->>'".$columns[0]->id."'");
->offset($start)->limit($chunkSize)->get()->toArray();
while ($start < $count) {
$rows = $rq->offset($start)->limit($chunkSize)->get()->toArray();
foreach ($rows as $row) { foreach ($rows as $row) {
unset($row['_row_pivot']); unset($row['_row_pivot']);

Loading…
Cancel
Save