浏览代码

Correctifs

refactoring
Guillaume Bourgeois 1年前
父节点
当前提交
3af0f375fb
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. +4
    -3
      producer/controllers/ProducerBaseController.php

+ 4
- 3
producer/controllers/ProducerBaseController.php 查看文件

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

正在加载...
取消
保存