Skip to content

Commit

Permalink
chore: use order by to get top most recent updated entity
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalsem committed Feb 23, 2017
1 parent 22d3334 commit f438663
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions classes/ColdTrick/GroupTools/StaleInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ protected function getContentTimestamp() {
'subtypes' => $object_subtypes,
'limit' => 1,
'container_guid' => $this->group->getGUID(),
'order_by' => 'e.time_updated DESC',
]);
if (empty($entities)) {
return 0;
Expand Down Expand Up @@ -132,6 +133,7 @@ protected function getCommentTimestamp() {
'wheres' => [
"(ce.container_guid = {$this->group->getGUID()})",
],
'order_by' => 'e.time_updated DESC',
]);
if (empty($entities)) {
return 0;
Expand Down
2 changes: 1 addition & 1 deletion languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@

// stale groups
'group_tools:stale_info:description' => "This group has been inactive for a while. The content may no longer be relevant.",
'group_tools:stale_info:link' => "This group is still relevent",
'group_tools:stale_info:link' => "This group is still relevant",

'group_tools:csv_exporter:stale_info:is_stale' => "Stale group",
'group_tools:csv_exporter:stale_info:timestamp' => "Stale timestamp",
Expand Down

0 comments on commit f438663

Please sign in to comment.