add reception changes

This commit is contained in:
2015-09-29 17:27:31 +02:00
parent 8e235a8d3c
commit 2b57f95b1e
4 changed files with 71 additions and 29 deletions

View File

@@ -4,6 +4,8 @@ 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.
@@ -11,8 +13,10 @@ use yii\base\Model;
class ReceptionForm extends Model
{
public $number;
public $card;
public $customer;
/**
* @inheritdoc
*/
@@ -23,6 +27,7 @@ class ReceptionForm extends Model
];
}
/**
* @inheritdoc
*/
@@ -32,5 +37,12 @@ class ReceptionForm extends Model
'verifyCode' => 'Verification Code',
];
}
public function readCard(){
$this->card = Card::findOne(['number' => $this->number]);
if ( $this->card != null ){
$this->customer = $this->card->customer;
}
}
}