|
|
|
|
@ -8,7 +8,7 @@ use Scalar::Util qw/blessed/;
|
|
|
|
|
use DateTime::Format::Strptime;
|
|
|
|
|
|
|
|
|
|
sub process {
|
|
|
|
|
my ($c, $rs, $cols) = @_;
|
|
|
|
|
my ($c, $rs, $cols, $row_func) = @_;
|
|
|
|
|
|
|
|
|
|
my $aaData = [];
|
|
|
|
|
my $totalRecords = $rs->count;
|
|
|
|
|
@ -92,6 +92,9 @@ sub process {
|
|
|
|
|
if(defined $topId) {
|
|
|
|
|
if(defined(my $row = $rs->find($topId))) {
|
|
|
|
|
push @{ $aaData }, _prune_row($cols, $row->get_inflated_columns);
|
|
|
|
|
if (defined $row_func) {
|
|
|
|
|
$aaData->[-1]->put($row_func->($row));
|
|
|
|
|
}
|
|
|
|
|
$rs = $rs->search({ 'me.id' => { '!=', $topId} });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -135,6 +138,9 @@ sub process {
|
|
|
|
|
|
|
|
|
|
for my $row ($rs->all) {
|
|
|
|
|
push @{ $aaData }, _prune_row($cols, $row->get_inflated_columns);
|
|
|
|
|
if (defined $row_func) {
|
|
|
|
|
$aaData->[-1]->put($row_func->($row));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$c->stash(
|
|
|
|
|
|