change cart to plain post from ajax
This commit is contained in:
@@ -7,6 +7,7 @@ use yii\base\Model;
|
||||
use common\models\Card;
|
||||
use common\models\Customer;
|
||||
use common\models\Ticket;
|
||||
use common\models\Account;
|
||||
|
||||
/**
|
||||
* ContactForm is the model behind the contact form.
|
||||
@@ -17,7 +18,7 @@ class ReceptionForm extends Model
|
||||
public $card;
|
||||
public $customer;
|
||||
public $tickets;
|
||||
|
||||
public $defaultAccount;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
@@ -44,11 +45,25 @@ class ReceptionForm extends Model
|
||||
|
||||
$this->number = str_replace("ö", "0", $this->number);
|
||||
|
||||
$this->card = Card::find()->andWhere(['or', [ 'in','number' , [$this->number]], ['and', ['in','rfid_key' ,[ $this->number] ],"trim(coalesce(rfid_key, '')) <>'' "]])->one();
|
||||
$this->card = Card::find()->andWhere(['or', ['and',[ 'in','number' , [$this->number]],"trim(coalesce(number, '')) <>'' " ], ['and', ['in','rfid_key' ,[ $this->number] ],"trim(coalesce(rfid_key, '')) <>'' "]])->one();
|
||||
if ( $this->card != null ){
|
||||
$this->customer = $this->card->customer;
|
||||
$this->readValidTickets();
|
||||
}
|
||||
|
||||
$defaultAccount = Account::readDefault();
|
||||
if ( isset($defaultAccount)){
|
||||
$this->defaultAccount = Account::findOne($defaultAccount);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getDefaultAccountName(){
|
||||
$result = "";
|
||||
if ( $this->defaultAccount ){
|
||||
$result = $this->defaultAccount->name;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function readValidTickets(){
|
||||
|
||||
Reference in New Issue
Block a user