registration fix

This commit is contained in:
2024-02-05 23:58:48 +03:00
parent 5cfd591140
commit eb1abd41e5
13 changed files with 83 additions and 10 deletions

View File

@ -5,12 +5,32 @@ namespace console\controllers;
use common\models\Reports;
use common\models\User;
use common\models\UserCard;
use Yii;
use yii\console\Controller;
class SqlController extends Controller
{
public $email = "";
/**
* @param $actionID
* @return string[]
*/
public function options($actionID)
{
return ['email'];
}
/**
* @return string[]
*/
public function optionAliases()
{
return ['e' => 'email'];
}
public function actionSalary()
{
$sql = "UPDATE user_card SET salary=REPLACE( `salary`, ' ', '' )";
@ -50,4 +70,14 @@ class SqlController extends Controller
echo "script completed successfully\n";
}
public function actionCreateProfile()
{
if ($profile = User::createSimpleProfile($this->email, 17)) {
echo "Профиль $profile->id успешно создан\n";
return;
}
echo "Пользователь $this->email не найден\n";
}
}