diff --git a/backend/modules/card/views/user-card/view.php b/backend/modules/card/views/user-card/view.php index 5a89d5f..526a803 100755 --- a/backend/modules/card/views/user-card/view.php +++ b/backend/modules/card/views/user-card/view.php @@ -103,7 +103,7 @@ $this->params['breadcrumbs'][] = $this->title; href=" $achievement['achievement']->id]);?>" class="btn btn-default btn-sm"> $achievement['achievement']->img, 'height' => '50px', 'alt'=> $achievement['achievement']->title] + ['src' => $achievement['achievement']->img, 'height' => '50px', 'width' => '50px', 'alt'=> $achievement['achievement']->title] ) ?> title; ?> diff --git a/frontend/modules/card/controllers/UserCardController.php b/frontend/modules/card/controllers/UserCardController.php index 40dfa43..f9f7d54 100755 --- a/frontend/modules/card/controllers/UserCardController.php +++ b/frontend/modules/card/controllers/UserCardController.php @@ -4,6 +4,7 @@ namespace frontend\modules\card\controllers; use common\classes\Debug; +use common\models\AchievementUserCard; use common\models\CardSkill; use common\models\FieldsValueNew; use common\models\User; @@ -60,10 +61,18 @@ class UserCardController extends Controller ]); $skills = CardSkill::find()->where(['card_id' => $id])->with('skill')->all(); + $achievements = AchievementUserCard::find() + ->where(['user_card_id' => $id]) + ->innerJoinWith(['achievement' => function($query) { + $query->andWhere(['status' => \common\models\Achievement::STATUS_ACTIVE]); + }]) + ->all(); + return $this->render('view', [ 'model' => $this->findModel($id), 'modelFildValue' => $dataProvider, 'skills' => $skills, + 'achievements' => $achievements, ]); } else return $this->render('index', ['info' => '

Ваши личные данные не заненсены в базу.

']); diff --git a/frontend/modules/card/views/user-card/view.php b/frontend/modules/card/views/user-card/view.php index d9c0437..4ed8aa4 100755 --- a/frontend/modules/card/views/user-card/view.php +++ b/frontend/modules/card/views/user-card/view.php @@ -7,6 +7,7 @@ use yii\widgets\DetailView; /* @var $this yii\web\View */ /* @var $skills \common\models\CardSkill */ /* @var $skill \common\models\Skill */ +/* @var $achievements \common\models\Achievement */ /* @var $modelFildValue yii\data\ActiveDataProvider */ /* @var $model */ @@ -31,13 +32,24 @@ $this->title = 'Профиль'; ], ]); ?> -

Навыки

name; ?> +

Достижения

+ + + $achievement['achievement']->img, 'height' => '50px','width' => '50px', 'alt'=> $achievement['achievement']->title] + ) ?> + title; ?> + + +

Дополнительные сведения