|
|
|
|
|
|
|
|
->where('id_producer = :id_producer') |
|
|
->where('id_producer = :id_producer') |
|
|
->andWhere('date >= :date_begin') |
|
|
->andWhere('date >= :date_begin') |
|
|
->andWhere('date >= :date_earliest_order'); |
|
|
->andWhere('date >= :date_earliest_order'); |
|
|
$incomingDistributions = Distribution::filterDistributionsByDateDelay($incomingDistributions) ; |
|
|
|
|
|
|
|
|
|
|
|
if ($this->date_end) { |
|
|
if ($this->date_end) { |
|
|
$incomingDistributions->andWhere('date < :date_end'); |
|
|
$incomingDistributions->andWhere('date < :date_end'); |
|
|
|
|
|
|
|
|
$incomingDistributions->params($params); |
|
|
$incomingDistributions->params($params); |
|
|
$incomingDistributionsArray = $incomingDistributions->all(); |
|
|
$incomingDistributionsArray = $incomingDistributions->all(); |
|
|
|
|
|
|
|
|
|
|
|
$incomingDistributions = Distribution::filterDistributionsByDateDelay($incomingDistributionsArray) ; |
|
|
|
|
|
|
|
|
$matchedIncomingDistributionsArray = []; |
|
|
$matchedIncomingDistributionsArray = []; |
|
|
foreach ($incomingDistributionsArray as $incomingDistribution) { |
|
|
foreach ($incomingDistributionsArray as $incomingDistribution) { |
|
|
if ($this->matchWith($incomingDistribution->date)) { |
|
|
if ($this->matchWith($incomingDistribution->date)) { |