Run onListing callback after applying sort/filtering to the query

This commit is contained in:
Toby Zerner 2021-05-05 14:23:04 +09:30
parent 7858566e1e
commit c563c2879b
1 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,6 @@ class Index
$query = $adapter->newQuery($context);
run_callbacks($schema->getListeners('listing'), [$query, $context]);
run_callbacks($schema->getListeners('scope'), [$query, $context]);
$include = $this->getInclude($context);
@ -68,6 +67,8 @@ class Index
$this->sort($query, $context);
$this->filter($query, $context);
run_callbacks($schema->getListeners('listing'), [$query, $context]);
$total = $schema->isCountable() ? $adapter->count($query) : null;
$models = $adapter->get($query);