status flag

This commit is contained in:
2016-03-11 07:41:51 +01:00
parent bc74d92463
commit 9c25312cf1
8 changed files with 49 additions and 5 deletions

View File

@@ -40,14 +40,15 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
left JOIN ( select distinct ticket.id_card as id_card from ticket
where ticket.start <= CURDATE() and ticket.end >= curdate() and ticket.status = 10 ) as t
on t.id_card = c1.id_card
SET c1.flag = case when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end";
SET c1.flag = case when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
WHERE c1.type <> 50";
public static $SQL_UPDATE_CARD = "UPDATE card as c1
left JOIN ( select distinct ticket.id_card as id_card from ticket
where ticket.start <= CURDATE() and ticket.end >= curdate() and ticket.status = 10 ) as t
on t.id_card = c1.id_card
SET c1.flag = case when t.id_card is null then ( c1.flag | 1 << 0 ) else ( c1.flag & ~(1 << 0) ) end
WHERE c1.id_card = :id";
WHERE c1.type <> 50 and c1.id_card = :id";
/**