add reception changes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user