doorcardpass && door move manager logging
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace console\controllers;
|
||||
|
||||
use common\manager\DoorCardPassManager;
|
||||
use common\models\Card;
|
||||
use /** @noinspection PhpUnusedAliasInspection */
|
||||
Yii;
|
||||
@@ -8,9 +9,11 @@ use yii\console\Controller;
|
||||
|
||||
class DoorCardPassController extends Controller{
|
||||
|
||||
public function actionDenyAllCard( )
|
||||
public function actionHardReset( )
|
||||
{
|
||||
\Yii::$app->db->createCommand(Card::SQL_DENY_DOOR_CARD_PASS())->execute();
|
||||
// \Yii::$app->db->createCommand(Card::SQL_DENY_DOOR_CARD_PASS())->execute();
|
||||
$manager = new DoorCardPassManager();
|
||||
$manager->hardReset();
|
||||
}
|
||||
|
||||
public function actionAllowAllCard( )
|
||||
@@ -18,12 +21,10 @@ class DoorCardPassController extends Controller{
|
||||
\Yii::$app->db->createCommand(Card::SQL_ALLOW_DOOR_CARD_PASS())->execute();
|
||||
}
|
||||
|
||||
public function actionDenyExpiredCard( )
|
||||
public function actionInvalidate( )
|
||||
{
|
||||
$now = date('Y-m-d H:i:s' );
|
||||
$now = time();
|
||||
\Yii::$app->db->createCommand(Card::SQL_DENY_DOOR_CARD_PASS_EXPIRED() ,['datetime'=> $now] )
|
||||
->execute();
|
||||
$manager = new DoorCardPassManager();
|
||||
$manager->updateDoorCardPassStateForAllCard();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Class m230126_202055_create_table_door_card_pass
|
||||
*/
|
||||
class m230209_200000_alter_table_door_card_pass_add_column_valid_until extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn("door_card_pass","valid_until_at",$this->dateTime());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
echo "m230126_202055_create_table_door_card_pass cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m230126_202055_create_table_door_card_pass cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Class m230126_202055_create_table_door_card_pass
|
||||
*/
|
||||
class m230209_200010_alter_table_door_card_pass_add_column_invalidated_at extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn("door_card_pass","invalidated_at",$this->dateTime());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
echo "m230126_202055_create_table_door_card_pass cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m230126_202055_create_table_door_card_pass cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user