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:
@@ -7,13 +7,14 @@ use Krzysiej\RyobiCrawler\Models\Product;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
use function Symfony\Component\Clock\now;
|
||||
|
||||
final class NewController extends BaseController
|
||||
{
|
||||
#[Route('/new', name: 'app_new')]
|
||||
public function __invoke(): Response
|
||||
{
|
||||
$date = (new \DateTime())->modify('-30 days')->format('Y-m-d');
|
||||
$products = Product::where('created_at', '>', $date)
|
||||
$products = Product::where('created_at', '>', now()->modify('-30 days')->format('Y-m-d'))
|
||||
->orderByDesc('starred')
|
||||
->orderByDesc('created_by')
|
||||
->with(['currentPrice'])
|
||||
|
||||
Reference in New Issue
Block a user