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=" echo \yii\helpers\Url::to(['/achievements/achievements/view', 'id' => $achievement['achievement']->id]);?>" class="btn btn-default btn-sm"> = Html::tag('img', null, - ['src' => $achievement['achievement']->img, 'height' => '50px', 'alt'=> $achievement['achievement']->title] + ['src' => $achievement['achievement']->img, 'height' => '50px', 'width' => '50px', 'alt'=> $achievement['achievement']->title] ) ?> = $achievement['achievement']->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' => '