|
|
|
|
|
|
|
|
public function selectSum(): self |
|
|
public function selectSum(): self |
|
|
{ |
|
|
{ |
|
|
$this->joinProduct(); |
|
|
$this->joinProduct(); |
|
|
$this->joinDistribution(); |
|
|
|
|
|
return $this |
|
|
return $this |
|
|
->select( |
|
|
->select( |
|
|
'SUM(orderProducts.quantityOrder) as quantity, distribution.cycleNumber as cycleNumber, distribution.year as year , product.id as productId' |
|
|
'SUM(orderProducts.quantityOrder) as quantity, distribution.cycleNumber as cycleNumber, distribution.year as year , product.id as productId' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function filterByDistributions(array $distributionArray): self |
|
|
public function filterByDistributions(array $distributionArray): self |
|
|
{ |
|
|
{ |
|
|
|
|
|
$this->joinDistribution(); |
|
|
return $this |
|
|
return $this |
|
|
->andWhere('.distribution IN (:distributions)') |
|
|
->andWhere('.distribution IN (:distributions)') |
|
|
->setParameter('distributions', $distributionArray); |
|
|
->setParameter('distributions', $distributionArray); |