update sort

This commit is contained in:
Dan Chadwick 2024-04-11 13:10:33 -07:00
parent 76647dded7
commit 763acc4fd0

View File

@ -34,8 +34,8 @@ public static function create(ContainerInterface $container) {
public function getRecentFights() {
$query = $this->entityTypeManager->getStorage('node')->getQuery();
$query->accessCheck(TRUE);
$query->condition('type', 'fight')->sort('created', 'DESC');
$query->range(0, 14);
$query->condition('type', 'fight')->sort('created', 'DESC')->sort('nid', 'DESC');
$query->range(0, 13);
$nids = $query->execute();
$all_fights = Node::loadMultiple($nids);
$fights = [];