Improvements to handling countries.

This commit was merged in pull request #51.
This commit is contained in:
2026-01-20 10:44:07 +01:00
committed by krzysiej
parent 9ec3291a6a
commit f9c58edccd
3 changed files with 5 additions and 5 deletions

View File

@@ -16,11 +16,11 @@ final class NewController extends BaseController
if($this->cache->getItem('list_new')->isHit()) {
return $this->render('productList.html.twig', ['listType' => 'new']);
}
$products = Product::where('created_at', '>', now()->modify('-30 days')->format('Y-m-d'))
$date = now()->modify('-30 days')->format('Y-m-d');
$products = Product::where('created_at', '>', $date)
->with(['country', 'stock'])
->orderByDesc('starred')
->orderByDesc('created_by')
->with(['currentPrice', 'lowestPrice'])
->get();
return $this->render('productList.html.twig', ['products' => $products, 'listType' => 'new']);
}