guild/console/controllers/SqlController.php
2020-05-22 16:42:24 +03:00

24 lines
485 B
PHP

<?php
namespace console\controllers;
use common\models\UserCard;
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();
echo "script completed successfully\n";
}
public function actionGenerateUser()
{
echo UserCard::generateUserForUserCard() . "\n";
}
}