|
|
|
|
|
|
|
|
|
|
|
|
|
|
// products |
|
|
// products |
|
|
$productsArray = Product::find() |
|
|
$productsArray = Product::find() |
|
|
->where([ |
|
|
|
|
|
'id_producer' => Producer::getId(), |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
->orWhere(['id_producer' => Producer::getId(),]) |
|
|
|
|
|
->orWhere(['id_producer' => 0,]) // produit "Don" |
|
|
->joinWith(['productDistribution' => function($query) use($distribution) { |
|
|
->joinWith(['productDistribution' => function($query) use($distribution) { |
|
|
$query->andOnCondition('product_distribution.id_distribution = '.$distribution->id) ; |
|
|
$query->andOnCondition('product_distribution.id_distribution = '.$distribution->id) ; |
|
|
}]) |
|
|
}]) |