Merge pull request #22 from apuc/show_user_info
Информация о пользователе frontend
This commit is contained in:
commit
14044057e3
@ -21,12 +21,13 @@ class UserCardController extends Controller
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
if(Yii::$app->user->isGuest) return $this->render('index', ['info' => '<h3>Пожалуйста, авторизируйтесь!</h3>']);
|
||||
else {
|
||||
$id_user = Yii::$app->user->id;
|
||||
$result = UserCard::find()->where(['id_user' => $id_user])->asArray()->all();
|
||||
$id = $result[0]['id'];
|
||||
|
||||
if(Yii::$app->user->isGuest) return $this->render('index', ['info' => '<h3>Пожалуйста, авторизируйтесь!</h3>']);
|
||||
else if($id) {
|
||||
if($result){
|
||||
$id = $result[0]['id'];
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => FieldsValueNew::find()
|
||||
->where(['item_id' => $id, 'item_type' => FieldsValueNew::TYPE_PROFILE])
|
||||
@ -46,6 +47,7 @@ class UserCardController extends Controller
|
||||
}
|
||||
else return $this->render('index', ['info' => '<h3>Ваши личные данные не заненсены в базу.</h3>']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the Product model based on its primary key value.
|
||||
|
Loading…
Reference in New Issue
Block a user