|
|
@@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace Lc\CaracoleBundle\Statistic\Product; |
|
|
|
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
|
|
use Lc\CaracoleBundle\Builder\Distribution\DistributionBuilder; |
|
|
|
use Lc\CaracoleBundle\Container\Order\OrderShopContainer; |
|
|
@@ -56,11 +57,14 @@ class ProductsSalesStatistic extends Statistic |
|
|
|
// Initialise les valeurs des données pour chaque Interval de date |
|
|
|
public function init(SectionInterface $section, DistributionBuilder $distributionBuilder) |
|
|
|
{ |
|
|
|
$this->distributionList = $distributionBuilder->getDistributionListFromCurrentOrder($section, $this->nbCycle); |
|
|
|
$distributionArray = $distributionBuilder->getDistributionListFromCurrentOrder($section, $this->nbCycle); |
|
|
|
$this->distributionList = $distributionArray->toArray(); |
|
|
|
|
|
|
|
// if ($openingResolver->isOpenSale($section, null,OpeningResolver::OPENING_CONTEXT_BACKEND) == false && date('w') > 2) { |
|
|
|
// $currentCycleNumber = $currentCycleNumber - 1; |
|
|
|
// } |
|
|
|
// @TODO : à retravailler pour inclure cette logique directement dans getDistributionListFromCurrentOrder() |
|
|
|
$distributionCurrentOrder = $distributionBuilder->guessCurrentDistributionOrder($section); |
|
|
|
if(!$distributionArray->contains($distributionCurrentOrder)) { |
|
|
|
array_unshift($this->distributionList, $distributionCurrentOrder); |
|
|
|
} |
|
|
|
|
|
|
|
foreach ($this->distributionList as $distribution){ |
|
|
|
$this->labels[$this->getKey($distribution->getCycleNumber(),$distribution->getYear())] = $distribution->getCycleNumber(); |