door card pass: create table and create model and console controller

This commit is contained in:
Schneider Roland
2023-02-08 19:42:42 +01:00
parent 3daa39a0b6
commit 4d44b1c2af
9 changed files with 307 additions and 19 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace console\controllers;
use common\models\Card;
use /** @noinspection PhpUnusedAliasInspection */
Yii;
use yii\console\Controller;
class DoorCardPassController extends Controller{
public function actionDenyAllCard( )
{
\Yii::$app->db->createCommand(Card::SQL_DENY_DOOR_CARD_PASS())->execute();
}
public function actionAllowAllCard( )
{
\Yii::$app->db->createCommand(Card::SQL_ALLOW_DOOR_CARD_PASS())->execute();
}
public function actionDenyExpiredCard( )
{
$now = date('Y-m-d H:i:s' );
$now = time();
\Yii::$app->db->createCommand(Card::SQL_DENY_DOOR_CARD_PASS_EXPIRED() ,['datetime'=> $now] )
->execute();
}
}