cutler movar doormove
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace frontend\controllers;
|
||||
|
||||
use common\manager\DoorManager;
|
||||
use common\manager\KeyDoorManager;
|
||||
use common\models\DoorManagerLog;
|
||||
use frontend\models\DoorManagerLogSearch;
|
||||
use frontend\models\InventorySearch;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
use common\models\VirtualKey;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use frontend\components\HtmlHelper;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $card common\models\Card */
|
||||
/* @var $customer common\models\Customer */
|
||||
@@ -15,23 +14,10 @@ use frontend\components\HtmlHelper;
|
||||
if (! ( isset($model) && isset($model->card))){
|
||||
return;
|
||||
}
|
||||
$activeCardPasses = \common\models\DoorCardPass::find()
|
||||
->andWhere(
|
||||
[
|
||||
'id_card' => $model->card->id_card,
|
||||
'invalidated_at' => null ,
|
||||
$virtualKeysNotInCreatedInTheLastXMinuteForCard = VirtualKey::readNotInCreatedInTheLastXMinutesByIdCard($model->card->id_card,5);
|
||||
|
||||
// [ '>=', $field , $start ]
|
||||
|
||||
|
||||
]
|
||||
)->andWhere(
|
||||
['>=', 'valid_until_at', \common\components\DateUtil::formatDateTimeUtc(\common\components\DateUtil::utcDateTime())],
|
||||
)
|
||||
->orderBy(['valid_until_at' => SORT_DESC ])->all();
|
||||
|
||||
if (count($activeCardPasses) > 0){
|
||||
$cardPass = $activeCardPasses[0];
|
||||
if (count($virtualKeysNotInCreatedInTheLastXMinuteForCard) > 0){
|
||||
$activeVirtualKey = $virtualKeysNotInCreatedInTheLastXMinuteForCard[0];
|
||||
?>
|
||||
<div>
|
||||
<?php
|
||||
@@ -42,7 +28,7 @@ if (! ( isset($model) && isset($model->card))){
|
||||
?>
|
||||
<div>
|
||||
<?php
|
||||
echo $cardPass->valid_until_at ;
|
||||
echo $activeVirtualKey->created_at ;
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user