You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
888B

  1. <?php
  2. namespace producer\controllers;
  3. class ProducerController extends ProducerBaseController {
  4. /**
  5. * @inheritdoc
  6. */
  7. public function behaviors() {
  8. return [];
  9. }
  10. public function actions() {
  11. return [
  12. 'error' => [
  13. 'class' => 'yii\web\ErrorAction',
  14. ],
  15. ];
  16. }
  17. public function actionIndex() {
  18. $etablissement = Etablissement::findOne(['slug' => Yii::$app->getRequest()->getQueryParam('slug_producer')]) ;
  19. $points_vente = [] ;
  20. if($etablissement) {
  21. $points_vente = PointVente::find()
  22. ->where([
  23. 'id_etablissement' => $etablissement->id,
  24. ])
  25. ->all() ;
  26. }
  27. return $this->render('index',[
  28. 'points_vente' => $points_vente
  29. ]) ;
  30. }
  31. }
  32. ?>