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;
$rq = $revision->rowsData($this->columns, false);
$columns = $this->columns;
// TODO raw query to allow selecting aggregates, column subsets, etc
if (count($columns)) $rq = $rq->orderByRaw("data->>'".$columns[0]->id."'");
while ($start < $count) { while ($start < $count) {
// TODO raw query to allow selecting aggregates, column subsets, etc $rows = $rq->offset($start)->limit($chunkSize)->get()->toArray();
$rows = $revision->rowsData($this->columns, false)
->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