|
|
|
|
|
|
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
// Produits |
|
|
// Produits |
|
|
/*if (Producer::getConfig('option_allow_user_gift')) { |
|
|
|
|
|
|
|
|
if (Producer::getConfig('option_allow_user_gift')) { |
|
|
$productsArray = Product::find() |
|
|
$productsArray = Product::find() |
|
|
->orWhere(['id_producer' => $this->getProducer()->id,]) |
|
|
->orWhere(['id_producer' => $this->getProducer()->id,]) |
|
|
//->orWhere(['id_producer' => 0,]) // produit "Don"; |
|
|
//->orWhere(['id_producer' => 0,]) // produit "Don"; |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
$productsArray = Product::find() |
|
|
$productsArray = Product::find() |
|
|
->where(['id_producer' => $this->getProducer()->id,]); |
|
|
->where(['id_producer' => $this->getProducer()->id,]); |
|
|
}*/ |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$productsArray = Product::find() |
|
|
|
|
|
|
|
|
/*$productsArray = Product::find() |
|
|
->where([ |
|
|
->where([ |
|
|
'id_producer' => $this->getProducer()->id, |
|
|
'id_producer' => $this->getProducer()->id, |
|
|
'active' => 1, |
|
|
'active' => 1, |
|
|
]); |
|
|
|
|
|
|
|
|
]);*/ |
|
|
|
|
|
|
|
|
$productsArray = $productsArray->joinWith(['productDistribution' => function ($query) use ($distribution) { |
|
|
$productsArray = $productsArray->joinWith(['productDistribution' => function ($query) use ($distribution) { |
|
|
$query->andOnCondition('product_distribution.id_distribution = ' . $distribution->id); |
|
|
$query->andOnCondition('product_distribution.id_distribution = ' . $distribution->id); |