add reception key changes, add money movent storno, status display

This commit is contained in:
2016-01-22 19:10:30 +01:00
parent a2a6b1f240
commit 027a96790a
24 changed files with 220 additions and 25 deletions

View File

@@ -60,6 +60,8 @@ class CardSearch extends Card
$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->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');
$query->leftJoin("key", 'key.id_key = card_key_assignment.id_key');
$query->orderBy(['customer.name' => SORT_ASC]);
@@ -77,9 +79,18 @@ class CardSearch extends Card
return $dataProvider;
}
$query->andFilterWhere([
// 'lower(customer.name)' => $this->customerName
]);
// $query->andFilterWhere([
// 'lower(card.number)' => $this->customerName
// ]);
if ( !empty($this->number)){
$query->andWhere(['or',
['and',[ 'in','card.number' , [$this->number]],"trim(coalesce(card.number, '')) <>'' " ],
['and', ['in','card.rfid_key' ,[ $this->number] ],"trim(coalesce(card.rfid_key, '')) <>'' "],
['and',[ 'in','key.number' , [$this->number]],"trim(coalesce(key.number, '')) <>'' " ],
['and', ['in','key.rfid_key' ,[ $this->number] ],"trim(coalesce(key.rfid_key, '')) <>'' "]
]);
}
$query->andFilterWhere(['like', 'customer.name', $this->customerName]);