You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -33,15 +32,24 @@ public function getCheckedInAttendeeCountById(int $checkInListId): CheckedInAtte
33
32
SELECT attendee_id, check_in_list_id
34
33
FROM attendee_check_ins
35
34
WHERE deleted_at IS NULL
35
+
AND check_in_list_id = :check_in_list_id
36
36
GROUP BY attendee_id, check_in_list_id
37
37
),
38
38
valid_attendees AS (
39
-
SELECT a.id, tcil.check_in_list_id
39
+
SELECT a.id, pcil.check_in_list_id
40
40
FROM attendees a
41
-
JOIN product_check_in_lists tcil ON a.product_id = tcil.product_id
41
+
JOIN product_check_in_lists pcil ON a.product_id = pcil.product_id
42
+
JOIN orders o ON a.order_id = o.id
43
+
JOIN check_in_lists cil ON pcil.check_in_list_id = cil.id
44
+
JOIN event_settings es ON cil.event_id = es.event_id
42
45
WHERE a.deleted_at IS NULL
43
-
AND tcil.deleted_at IS NULL
44
-
AND a.status in ('ACTIVE', 'AWAITING_PAYMENT')
46
+
AND pcil.deleted_at IS NULL
47
+
AND pcil.check_in_list_id = :check_in_list_id
48
+
AND (
49
+
(es.allow_orders_awaiting_offline_payment_to_check_in = true AND a.status in ('ACTIVE', 'AWAITING_PAYMENT') AND o.status IN ('COMPLETED', 'AWAITING_OFFLINE_PAYMENT'))
50
+
OR
51
+
(es.allow_orders_awaiting_offline_payment_to_check_in = false AND a.status = 'ACTIVE' AND o.status = 'COMPLETED')
52
+
)
45
53
)
46
54
SELECT
47
55
cil.id AS check_in_list_id,
@@ -67,22 +75,30 @@ public function getCheckedInAttendeeCountById(int $checkInListId): CheckedInAtte
JOIN product_check_in_lists tcil ON a.product_id = tcil.product_id
90
+
JOIN product_check_in_lists pcil ON a.product_id = pcil.product_id
91
+
JOIN orders o ON a.order_id = o.id
92
+
JOIN check_in_lists cil ON pcil.check_in_list_id = cil.id
93
+
JOIN event_settings es ON cil.event_id = es.event_id
83
94
WHERE a.deleted_at IS NULL
84
-
AND tcil.deleted_at IS NULL
85
-
AND a.status = '$attendeeActiveStatus'
95
+
AND pcil.deleted_at IS NULL
96
+
AND pcil.check_in_list_id IN ($placeholders)
97
+
AND (
98
+
(es.allow_orders_awaiting_offline_payment_to_check_in = true AND a.status IN ('ACTIVE', 'AWAITING_PAYMENT') AND o.status IN ('COMPLETED', 'AWAITING_OFFLINE_PAYMENT'))
99
+
OR
100
+
(es.allow_orders_awaiting_offline_payment_to_check_in = false AND a.status = 'ACTIVE' AND o.status = 'COMPLETED')
101
+
)
86
102
)
87
103
SELECT
88
104
cil.id AS check_in_list_id,
@@ -96,7 +112,7 @@ public function getCheckedInAttendeeCountByIds(array $checkInListIds): Collectio
0 commit comments