Skip to content

Commit

Permalink
Fix history view loading time
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Jan 15, 2024
1 parent 274b903 commit 8b9459b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion application/controllers/HistoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ public function indexAction()
$history->limit($page * $limitControl->getLimit());
}

$history->filter(Filter::lessThanOrEqual('event_time', $before));
$eventTimeQuery = History::on($db)
->columns(['id'])
->filter(Filter::lessThanOrEqual('event_time', $before))
->assembleSelect()
->resetOrderBy();

$history->getSelectBase()
->where(['history.id IN (?)' => $eventTimeQuery]);

$this->filter($history, $filter);

$history->getWith()['history.host']->setJoinType('LEFT');
Expand Down

0 comments on commit 8b9459b

Please sign in to comment.