add status to login method

This commit is contained in:
iIronside 2023-02-21 21:20:13 +03:00
parent 3ac2d54ec2
commit 06cfa93adf
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,43 @@
<?php
use yii\db\Migration;
/**
* Class m230221_181446_add_partner_to_status_table
*/
class m230221_181446_add_partner_to_status_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->insert('status',
[
'name' => 'Партнер',
]);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->delete('status', ['name' => 'Партнер']);
}
/*
// Use up()/down() to run migration code without a transaction.
public function up()
{
}
public function down()
{
echo "m230221_181446_add_partner_to_status_table cannot be reverted.\n";
return false;
}
*/
}

View File

@ -66,6 +66,7 @@ class UserController extends ActiveController
'access_token' => $model->login(), 'access_token' => $model->login(),
'access_token_expired_at' => $model->getUser()->getTokenExpiredAt(), 'access_token_expired_at' => $model->getUser()->getTokenExpiredAt(),
'id' => $model->getUser()->id, 'id' => $model->getUser()->id,
'status' => $model->getUser()->status,
'card_id' => $model->getUser()->userCard->id ?? null, 'card_id' => $model->getUser()->userCard->id ?? null,
]; ];
} else { } else {