Sfoglia il codice sorgente

Correctifs

refactoring
Guillaume Bourgeois 1 anno fa
parent
commit
3af0f375fb
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. +4
    -3
      producer/controllers/ProducerBaseController.php

+ 4
- 3
producer/controllers/ProducerBaseController.php Vedi File

@@ -110,17 +110,18 @@ class ProducerBaseController extends CommonController
return $this->producer ;
}
else {
$slug = \Yii::$app->getRequest()->getQueryParam('slug_producer');
$producer = Producer::find()
->with('contact')
->where(['slug' => \Yii::$app->getRequest()->getQueryParam('slug_producer')])
->where(['slug' => $slug])
->one() ;
if($producer) {
$this->producer = $producer ;
return $this->producer ;
}
}
else {
throw new \yii\web\HttpException(404, 'Producteur introuvable');
throw new \yii\web\HttpException(404, 'Producteur introuvable ('.$slug.')');
}
}
}

Loading…
Annulla
Salva