Browse Source

Correctifs

refactoring
Guillaume Bourgeois 1 year ago
parent
commit
3af0f375fb
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      producer/controllers/ProducerBaseController.php

+ 4
- 3
producer/controllers/ProducerBaseController.php View 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…
Cancel
Save