瀏覽代碼

Correctifs

refactoring
Guillaume Bourgeois 1 年之前
父節點
當前提交
3af0f375fb
共有 1 個檔案被更改,包括 4 行新增3 行删除
  1. +4
    -3
      producer/controllers/ProducerBaseController.php

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

@@ -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…
取消
儲存