|
|
@@ -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.')'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |