Increase speed of processing the prices and products. Because this is getting out of hand.

This commit was merged in pull request #33.
This commit is contained in:
krzysiej committed 2026-01-08 17:18:46 +01:00
1 parent de4915972c
commit 8e8ef8fe04
7 files changed
+67 -15

No files matched your search

+2 -1
View File
@@ -31,6 +31,7 @@ class AppExtension extends AbstractExtension
new TwigFilter('findByCreatedAtDate', [$this, 'findByCreatedAtDate']),
];
}
public function allCount(): int
{
return Product::count();
@@ -38,7 +39,7 @@ class AppExtension extends AbstractExtension
public function promosCount(): int
{
return Product::whereHas('currentPrice', fn(Builder $query) => $query->whereColumn('price', '<', 'productStandardPrice'))->count();
return Product::whereRaw('priceCurrent < productStandardPrice')->count();
}
public function newCount(): int