guild/console/controllers/SqlController.php
2020-01-24 12:05:34 +03:00

24 lines
499 B
PHP

<?php
namespace console\controllers;
use backend\modules\card\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";
}
}