Keep track of discontinued items. That means items that were tracked, but then they were never updated.Added is discontinued badge.
This commit is contained in:
24
src/Controller/DiscontinuedController.php
Normal file
24
src/Controller/DiscontinuedController.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Krzysiej\RyobiCrawler\Controller;
|
||||
|
||||
use Krzysiej\RyobiCrawler\Models\Product;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
use function Symfony\Component\Clock\now;
|
||||
|
||||
final class DiscontinuedController extends BaseController
|
||||
{
|
||||
#[Route('/discontinued', name: 'app_discontinued')]
|
||||
public function __invoke(): Response
|
||||
{
|
||||
|
||||
$products = Product::where('updated_at', '<', now()->format('Y-m-d'))
|
||||
->orderByDesc('starred')
|
||||
->orderByDesc('created_by')
|
||||
->with(['currentPrice'])
|
||||
->get();
|
||||
return $this->render('productList.html.twig', ['products' => $products]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user