49 lines
783 B
PHP
49 lines
783 B
PHP
<?php
|
|
|
|
namespace frontend\models;
|
|
|
|
use Yii;
|
|
use yii\base\Model;
|
|
use common\models\Card;
|
|
use common\models\Customer;
|
|
|
|
/**
|
|
* ContactForm is the model behind the contact form.
|
|
*/
|
|
class ReceptionForm extends Model
|
|
{
|
|
public $number;
|
|
public $card;
|
|
public $customer;
|
|
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
[['number'], 'required'],
|
|
];
|
|
}
|
|
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function attributeLabels()
|
|
{
|
|
return [
|
|
'verifyCode' => 'Verification Code',
|
|
];
|
|
}
|
|
|
|
public function readCard(){
|
|
$this->card = Card::findOne(['number' => $this->number]);
|
|
if ( $this->card != null ){
|
|
$this->customer = $this->card->customer;
|
|
}
|
|
}
|
|
|
|
}
|