door card pass: create table and create model and console controller
This commit is contained in:
29
console/controllers/DoorCardPassController.php
Normal file
29
console/controllers/DoorCardPassController.php
Normal 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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user