add editable account on reception/customer-cart, add towel handling
This commit is contained in:
@@ -16,6 +16,7 @@ class CardSearch extends Card
|
||||
{
|
||||
|
||||
public $customerName;
|
||||
public $towel;
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
@@ -23,7 +24,8 @@ class CardSearch extends Card
|
||||
{
|
||||
return [
|
||||
['customerName','string','max' =>200],
|
||||
['number','string','max' =>200]
|
||||
['number','string','max' =>200],
|
||||
['towel','integer']
|
||||
];
|
||||
}
|
||||
|
||||
@@ -40,7 +42,8 @@ class CardSearch extends Card
|
||||
return ArrayHelper::merge(parent::attributeLabels(),
|
||||
[
|
||||
'card_number' => 'Kártya szám',
|
||||
'customerName' => 'Vendég'
|
||||
'customerName' => 'Vendég',
|
||||
'towel' => 'Törölköző'
|
||||
]
|
||||
);
|
||||
|
||||
@@ -57,7 +60,7 @@ class CardSearch extends Card
|
||||
{
|
||||
|
||||
$query = new Query();
|
||||
$query->select(['card.id_card as card_id_card', 'card.number as card_number' , 'customer.name as customer_name', 'customer.email as customer_email','customer.phone as customer_phone']);
|
||||
$query->select(['card.id_card as card_id_card', 'card.number as card_number' , 'customer.name as customer_name', 'customer.email as customer_email','customer.phone as customer_phone','customer.towel_count as towel_count']);
|
||||
$query->from('card');
|
||||
$query->innerJoin('customer','card.id_card = customer.id_customer_card');
|
||||
$query->leftJoin("card_key_assignment", 'card.id_card = card_key_assignment.id_card');
|
||||
@@ -85,6 +88,10 @@ class CardSearch extends Card
|
||||
'asc' => ['customer.email' => SORT_ASC ],
|
||||
'desc' => ['customer.email' => SORT_DESC],
|
||||
],
|
||||
'towel_count' => [
|
||||
'asc' => ['customer.towel_count' => SORT_ASC ],
|
||||
'desc' => ['customer.towel_count' => SORT_DESC],
|
||||
],
|
||||
],
|
||||
'defaultOrder' =>[
|
||||
'customer_name' => SORT_ASC,
|
||||
@@ -115,6 +122,10 @@ class CardSearch extends Card
|
||||
]);
|
||||
}
|
||||
|
||||
if ( isset($this->towel) && !empty($this->towel)){
|
||||
$query->andWhere(['>','customer.towel_count',0]);
|
||||
}
|
||||
|
||||
$query->andFilterWhere(['like', 'customer.name', $this->customerName]);
|
||||
|
||||
return $dataProvider;
|
||||
|
||||
Reference in New Issue
Block a user