Browse Source

[Backend] Amélioration nombre de commande par produits

develop
Fab 3 years ago
parent
commit
3e4c6a6a0e
1 changed files with 0 additions and 15 deletions
  1. +0
    -15
      ShopBundle/Repository/OrderShopRepository.php

+ 0
- 15
ShopBundle/Repository/OrderShopRepository.php View File

} }




public function countValidOrderProductsOfWeekByProduct($weekNumber, $productId)
{
$query = $this->findByMerchantQuery();
$query = $this->filterOrderValid($query);
$query->andWhere('e.weekNumber = :weekNumber');
$query->setParameter('weekNumber', $weekNumber);
$query->leftJoin('e.orderProducts', 'orderProduct');
$query->andWhere('orderProduct.product = :product');
$query->setParameter('product', $productId);
$query->select('SUM(orderProduct.quantityOrder) as quantity');

$result = $query->getQuery()->getOneOrNullResult();


return $result['quantity'];

}
} }

Loading…
Cancel
Save