Pārlūkot izejas kodu

Application de l'option "Autoriser les utilisateurs à effectuer un don à la plateforme"

dev
Guillaume Bourgeois pirms 5 gadiem
vecāks
revīzija
b2fa57d912
1 mainītis faili ar 11 papildinājumiem un 4 dzēšanām
  1. +11
    -4
      producer/controllers/OrderController.php

+ 11
- 4
producer/controllers/OrderController.php Parādīt failu

@@ -534,10 +534,17 @@ class OrderController extends ProducerBaseController
]);
// Produits
$productsArray = Product::find()
->orWhere(['id_producer' => $this->getProducer()->id,])
->orWhere(['id_producer' => 0,]) // produit "Don"
->joinWith(['productDistribution' => function($query) use($distribution) {
if(Producer::getConfig('option_allow_user_gift')) {
$productsArray = Product::find()
->orWhere(['id_producer' => $this->getProducer()->id,])
->orWhere(['id_producer' => 0,]) ; // produit "Don";
}
else {
$productsArray = Product::find()
->where(['id_producer' => $this->getProducer()->id,]) ;
}
$productsArray = $productsArray->joinWith(['productDistribution' => function($query) use($distribution) {
$query->andOnCondition('product_distribution.id_distribution = '.$distribution->id) ;
}])
->orderBy('product_distribution.active DESC, order ASC')

Notiek ielāde…
Atcelt
Saglabāt