Merge pull request 'Order by starred flag and create date in promos view' (#7) from fix/ordering-promo-items into master
Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
@@ -12,7 +12,11 @@ final class PromosController extends BaseController
|
|||||||
#[Route('/promos', name: 'app_promos')]
|
#[Route('/promos', name: 'app_promos')]
|
||||||
public function __invoke(): Response
|
public function __invoke(): Response
|
||||||
{
|
{
|
||||||
$products = Product::whereHas('currentPrice', fn(Builder $query) => $query->whereColumn('price', '<', 'productStandardPrice'))->with(['currentPrice'])->get();
|
$products = Product::whereHas('currentPrice', fn(Builder $query) => $query->whereColumn('price', '<', 'productStandardPrice'))
|
||||||
|
->orderByDesc('starred')
|
||||||
|
->orderByDesc('created_by')
|
||||||
|
->with(['currentPrice'])
|
||||||
|
->get();
|
||||||
return $this->render('productList.html.twig', ['products' => $products]);
|
return $this->render('productList.html.twig', ['products' => $products]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user