add card.flag implementation

This commit is contained in:
2016-03-09 20:16:19 +01:00
parent 1d3c476476
commit 42c326f407
25 changed files with 497 additions and 80 deletions

View File

@@ -16,7 +16,7 @@ return [
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
'levels' => ['error', 'warning','info'],
],
],
],

View File

@@ -0,0 +1,21 @@
<?php
namespace console\controllers;
use Yii;
use common\models;
use yii\console\Controller;
use common\models\Ticket;
class TicketController extends Controller{
public function actionIndex()
{
$connection = \Yii::$app->db;
$command = $connection->createCommand( Ticket::$SQL_UPDATE );
$result = $command->execute();
\Yii::info("Tickets updated: " . $result );
echo "Tickets updated: " . $result ;
}
}

View File

@@ -0,0 +1,31 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160308_201451_add_door_flag extends Migration
{
public function up()
{
$this->addColumn("door_log", "card_flag", "int default 0");
$this->addColumn("card", "flag", "int default 0");
}
public function down()
{
echo "m160308_201451_add_door_flag cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}