Merge branch 'release/v0.1.16'

This commit is contained in:
Roland Schneider 2019-06-04 07:25:51 +02:00
commit 762ba0b833
3 changed files with 14 additions and 9 deletions

View File

@ -1,3 +1,5 @@
-0.1.16
- improve employee card validity calculation
-0.1.15
- fix null pointer when displaying warning in reception , when no ticket
-0.1.14

View File

@ -5,7 +5,7 @@ return [
'supportEmail' => 'rocho02@gmail.com',
'infoEmail' => 'info@rocho-net.hu',
'user.passwordResetTokenExpire' => 3600,
'version' => 'v0.1.15',
'version' => 'v0.1.16',
'company' => 'movar',//gyor
'company_name' => "Freimann Kft.",
'product_visiblity' => 'account',// on reception which products to display. account or global

View File

@ -56,10 +56,13 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
order by id_card desc
) as t
on t.id_card = c1.id_card
SET c1.validity = case when t.id_card is null then ( c1.validity | 1 << 0 ) else ( c1.validity & ~(1 << 0) ) end
, c1.flag = case when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
, c1.id_ticket_current = case when t.id_ticket is null then null else t.id_ticket end
WHERE c1.type <> 50";
-- first bit is 0 , when there is a valid ticket or the card is 'employee' => 0000 0000
-- first bit is 1, when card is not employee and there is no valid card => 0000 0001
SET c1.validity = case when c1.type = 50 then ( c1.validity & ~(1 << 0) ) when t.id_card is null then ( c1.validity | 1 << 0 ) else ( c1.validity & ~(1 << 0) ) end
-- first bit is 0 when there is a ticket or 'employee' card 0000 0000
-- first bit is 1 when there is no ticket and card type is not 'employee'
, c1.flag = case when c1.type = 50 then ( c1.flag & ~(1 << 0) ) when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
, c1.id_ticket_current = case when t.id_ticket is null then null else t.id_ticket end";
public static $SQL_UPDATE_CARD = "UPDATE card as c1
left JOIN ( select ticket.id_card as id_card , max(ticket.id_ticket) as id_ticket
@ -73,10 +76,10 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
order by id_card desc
) as t
on t.id_card = c1.id_card
SET c1.validity = case when t.id_card is null then ( c1.validity | 1 << 0 ) else ( c1.validity & ~(1 << 0) ) end
,c1.flag = case when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
SET c1.validity = case when c1.type = 50 then ( c1.validity & ~(1 << 0) ) when t.id_card is null then ( c1.validity | 1 << 0 ) else ( c1.validity & ~(1 << 0) ) end
,c1.flag = case when c1.type = 50 then ( c1.flag & ~(1 << 0) ) when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
, c1.id_ticket_current = case when t.id_ticket is null then null else t.id_ticket end
WHERE c1.type <> 50 and c1.id_card = :id";
WHERE c1.id_card = :id";