add feature enable/disable reception door log

This commit is contained in:
2017-02-28 20:29:10 +01:00
parent f27528d4cb
commit 1ff1d03a07
13 changed files with 223 additions and 115 deletions

View File

@@ -52,7 +52,37 @@ class ReceptionForm extends Model
'verifyCode' => 'Verification Code',
];
}
public function preReadCard(){
$this->number = Helper::fixAsciiChars( $this->number );
$query = Card::find();
$query->leftJoin("card_key_assignment", 'card.id_card = card_key_assignment.id_card');
$query->leftJoin("key", 'key.id_key = card_key_assignment.id_key');
$query->andWhere(['or',
['and',[ 'in','card.number' , [$this->number]],"trim(coalesce(card.number, '')) <>'' " ],
['and', ['in','card.rfid_key' ,[ $this->number] ],"trim(coalesce(card.rfid_key, '')) <>'' "],
['and',[ 'in','key.number' , [$this->number]],"trim(coalesce(key.number, '')) <>'' " ],
['and', ['in','key.rfid_key' ,[ $this->number] ],"trim(coalesce(key.rfid_key, '')) <>'' "]
]);
$this->card = $query->one();
if ( $this->card == null ){
}
if ( $this->card != null ){
$this->customer = $this->card->customer;
$this->readValidTickets();
}
}
public function readCard(){
$this->number = Helper::fixAsciiChars( $this->number );
@@ -71,10 +101,7 @@ class ReceptionForm extends Model
$this->card = $query->one();
if ( $this->card == null ){
}
if ( $this->card != null ){
$this->customer = $this->card->customer;
$this->readValidTickets();