2020-01-24 11:04:48 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace console\controllers;
|
|
|
|
|
|
|
|
|
2020-01-24 12:05:34 +03:00
|
|
|
use backend\modules\card\models\UserCard;
|
2020-01-24 11:04:48 +03:00
|
|
|
use Yii;
|
|
|
|
use yii\console\Controller;
|
|
|
|
|
|
|
|
class SqlController extends Controller
|
|
|
|
{
|
|
|
|
public function actionSalary()
|
|
|
|
{
|
|
|
|
$sql = "UPDATE user_card SET salary=REPLACE( `salary`, ' ', '' )";
|
|
|
|
Yii::$app->db->createCommand($sql)->execute();
|
2020-01-24 12:05:34 +03:00
|
|
|
echo "script completed successfully\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
public function actionGenerateUser()
|
|
|
|
{
|
|
|
|
echo UserCard::generateUserForUserCard() . "\n";
|
2020-01-24 11:04:48 +03:00
|
|
|
}
|
|
|
|
}
|