소스 검색

[Site] Correctif nav_user_top : accès producer current

feature/souke
Guillaume Bourgeois 9 달 전
부모
커밋
24f894db5f
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. +4
    -1
      common/views/nav_user_top.php

+ 4
- 1
common/views/nav_user_top.php 파일 보기

@@ -2,16 +2,19 @@

use common\helpers\GlobalParam;
use common\logic\Producer\Producer\Model\Producer;
use common\logic\Producer\Producer\Module\ProducerModule;
use common\logic\User\User\Module\UserModule;
use yii\bootstrap\Nav;
use yii\helpers\Html;

$userModule = UserModule::getInstance();
$producerModule = ProducerModule::getInstance();
$userCurrent = GlobalParam::getCurrentUser();

$isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent);
$producer = null;
if ($isUserCurrentGrantedAsProducer) {
$producer = Producer::searchOne(['id' => \Yii::$app->user->identity->id_producer]);
$producer = $producerModule->getRepository()->findOneProducerById(\Yii::$app->user->identity->id_producer);
}

?>

Loading…
취소
저장