Browse Source

[Backend] PackProduct : Statistiques de vente #116

packProduct
Fabien Normand 2 years ago
parent
commit
82cc65b422
3 changed files with 6 additions and 2 deletions
  1. +1
    -0
      Repository/Order/OrderShopRepositoryQuery.php
  2. +3
    -1
      Repository/Order/OrderShopStore.php
  3. +2
    -1
      Statistic/Product/ProductsSalesStatistic.php

+ 1
- 0
Repository/Order/OrderShopRepositoryQuery.php View File

); );
} }



public function selectSum(): self public function selectSum(): self
{ {
$this->joinProduct(); $this->joinProduct();

+ 3
- 1
Repository/Order/OrderShopStore.php View File

use Lc\CaracoleBundle\Model\Distribution\DistributionInterface; use Lc\CaracoleBundle\Model\Distribution\DistributionInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Order\OrderStatusModel; use Lc\CaracoleBundle\Model\Order\OrderStatusModel;
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Model\Product\ProductInterface; use Lc\CaracoleBundle\Model\Product\ProductInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
public function countValidOrderProductsOfDistributionsByProducts( public function countValidOrderProductsOfDistributionsByProducts(
array $distributions, array $distributions,
array $products, array $products,
ProductFamilyInterface $productFamily,
$query = null $query = null
): array { ): array {
$query = $this->createDefaultQuery($query); $query = $this->createDefaultQuery($query);
->groupBy('distribution.cycleNumber, product.id'); ->groupBy('distribution.cycleNumber, product.id');


//TODO vérifier ou est utilisé cette fonction ??? //TODO vérifier ou est utilisé cette fonction ???
dump($query->find());
return $query->find(); return $query->find();
} }



+ 2
- 1
Statistic/Product/ProductsSalesStatistic.php View File

{ {
$countsOrderedByCyclesAndProducts = $orderShopStore->countValidOrderProductsOfDistributionsByProducts( $countsOrderedByCyclesAndProducts = $orderShopStore->countValidOrderProductsOfDistributionsByProducts(
$this->distributionList, $this->distributionList,
$this->productIds
$this->productIds,
$this->productFamily
); );


foreach ($countsOrderedByCyclesAndProducts as $result) { foreach ($countsOrderedByCyclesAndProducts as $result) {

Loading…
Cancel
Save