Skip to content

Commit

Permalink
improved the report list sorting. Closes #93
Browse files Browse the repository at this point in the history
  • Loading branch information
liuch committed Jul 21, 2023
1 parent 8165b2d commit dd0e87d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/Database/Mariadb/ReportMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function list(array &$filter, array &$order, array &$limit): array
$limit_str = $this->sqlLimit($limit);
try {
$st = $db->prepare(
'SELECT `org`, `begin_time`, `end_time`, `fqdn`, external_id, `seen`, SUM(`rcount`) AS `rcount`,'
'SELECT `org`, `begin_time`, `end_time`, `fqdn`, `external_id`, `seen`, SUM(`rcount`) AS `rcount`,'
. ' MIN(`dkim_align`) AS `dkim_align`, MIN(`spf_align`) AS `spf_align`,'
. ' MIN(`disposition`) AS `disposition` FROM `' . $this->connector->tablePrefix('rptrecords')
. '` AS `rr` RIGHT JOIN (SELECT `rp`.`id`, `org`, `begin_time`, `end_time`, `external_id`,'
Expand Down Expand Up @@ -557,7 +557,7 @@ private function sqlOrderList(array &$order): string
{

$dir = $order['direction'] === 'ascent' ? 'ASC' : 'DESC';
return " ORDER BY `{$order['field']}` {$dir}";
return " ORDER BY `{$order['field']}` {$dir}, `rp`.`id` {$dir}";
}

/**
Expand Down

0 comments on commit dd0e87d

Please sign in to comment.