Procházet zdrojové kódy

Adaptations refactoring/traduction producer/controllers/ProducerBaseController

dev
Guillaume Bourgeois před 6 roky
rodič
revize
446068bcb9
1 změnil soubory, kde provedl 6 přidání a 6 odebrání
  1. +6
    -6
      producer/controllers/ProducerBaseController.php

+ 6
- 6
producer/controllers/ProducerBaseController.php Zobrazit soubor

@@ -73,14 +73,14 @@ class ProducerBaseController extends CommonController
}
// si l'utilisateur est connecté et qu'il n'a pas encore saisi de code
else {
$user_etablissement = UserEtablissement::find()
$userProducer = UserProducer::find()
->where([
'id_user' => Yii::$app->user->id,
'id_etablissement' => $producer->id
'id_user' => User::getId(),
'id_producer' => $producer->id
])
->one() ;
if(!$user_etablissement || ($user_etablissement && !$user_etablissement->actif)) {
if(!$userProducer || ($userProducer && !$userProducer->active)) {
$this->redirect(Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer-code','id' => $producer->id])) ;
}
}
@@ -101,7 +101,7 @@ class ProducerBaseController extends CommonController
return $this->producer ;
}
else {
$producer = Etablissement::find()
$producer = Producer::find()
->with('contact')
->where(['slug' => Yii::$app->getRequest()->getQueryParam('slug_producer')])
->one() ;
@@ -111,7 +111,7 @@ class ProducerBaseController extends CommonController
return $this->producer ;
}
else {
throw new \yii\web\HttpException(404, 'Établissement introuvable');
throw new \yii\web\HttpException(404, 'Producteur introuvable');
}
}
}

Načítá se…
Zrušit
Uložit