информация о пользователе

This commit is contained in:
Glambertessa 2019-11-18 10:55:53 +03:00
parent 1f9ddd8c09
commit 6640bf5ed9
2 changed files with 1 additions and 13 deletions

View File

@ -52,7 +52,7 @@ return [
'enablePrettyUrl' => true, 'enablePrettyUrl' => true,
'showScriptName' => false, 'showScriptName' => false,
'rules' => [ 'rules' => [
'' => 'card1/user-card/index', '' => 'card/user-card/index',
'site/index' => 'card/user-card/index', 'site/index' => 'card/user-card/index',
], ],
], ],

View File

@ -5,7 +5,6 @@ namespace frontend\modules\card\controllers;
use common\models\CardSkill; use common\models\CardSkill;
use common\models\FieldsValueNew; use common\models\FieldsValueNew;
use common\models\User;
use Yii; use Yii;
use common\models\UserCard; use common\models\UserCard;
use yii\data\ActiveDataProvider; use yii\data\ActiveDataProvider;
@ -21,13 +20,6 @@ class UserCardController extends Controller
*/ */
public function actionIndex() public function actionIndex()
{ {
/* $id_user = Yii::$app->user->id;
$id = UserCard::find()->where(['id_user' => $id_user])->asArray()->all();
return $this->render('index', [
'model' => $this->findModel($id[0]['id']),
]);*/
$id_user = Yii::$app->user->id; $id_user = Yii::$app->user->id;
$result = UserCard::find()->where(['id_user' => $id_user])->asArray()->all(); $result = UserCard::find()->where(['id_user' => $id_user])->asArray()->all();
$id = $result[0]['id']; $id = $result[0]['id'];
@ -43,14 +35,10 @@ class UserCardController extends Controller
$skills = CardSkill::find()->where(['card_id' => $id])->with('skill')->all(); $skills = CardSkill::find()->where(['card_id' => $id])->with('skill')->all();
$id_current_user = $this->findModel($id)->id_user;
return $this->render('index', [ return $this->render('index', [
'model' => $this->findModel($id), 'model' => $this->findModel($id),
'modelFildValue' => $dataProvider, 'modelFildValue' => $dataProvider,
'skills' => $skills, 'skills' => $skills,
// 'userData' => $userData,
//userData' => User::findOne($id_current_user),
]); ]);
} }