Remove trigger condition - maximalize enter count with ticket
This commit is contained in:
@@ -44,6 +44,15 @@ class Card extends \common\models\BaseFitnessActiveRecord
|
||||
UPDATE card set flag = ( flag & ~(1 << 1 ) ), flag_out= ( flag_out & ~(1 << 1 ) ) where card.type <> 50
|
||||
";
|
||||
|
||||
public static $SQL_FIX_KEY_STATUS = "
|
||||
update card as c1
|
||||
left join card_key_assignment k
|
||||
on k.id_card = c1.id_card
|
||||
set flag = CASE WHEN k.id_key is null then (c1.flag | 1 << 2) else ( c1.flag & ~(1 << 2 ) ) end,
|
||||
flag_out = CASE WHEN k.id_key is null then ( c1.flag_out & ~(1 << 2 )) else (c1.flag_out | 1 << 2 ) end
|
||||
WHERE c1.type <> 50
|
||||
";
|
||||
|
||||
public static $SQL_CLEARS_STATUS_DOOR_IN = "
|
||||
UPDATE card set flag = ( flag & ~(1 << 1 ) ) WHERE card.type <> 50 and card.id_card = :id
|
||||
";
|
||||
|
||||
Reference in New Issue
Block a user