Fixes error in JICOFO conferences stats

main
Yasen Pramatarov 2024-08-09 12:17:05 +03:00
parent c915bcba9e
commit 91aac20998
1 changed files with 11 additions and 1 deletions

View File

@ -5,15 +5,25 @@
return [ return [
// number of conferences for time period (if given) // number of conferences for time period (if given)
// NB we need to cross check with first occurrence of "bridge selected"
// as in Jicofo logs there is no way to get the time for conference ID creation
'conference_number' => " 'conference_number' => "
SELECT COUNT(c.conference_id) as conferences SELECT COUNT(c.conference_id) as conferences
FROM FROM
conferences c conferences c
LEFT JOIN (
SELECT ce.conference_id, MIN(ce.time) as first_event_time
FROM conference_events ce
WHERE ce.conference_event = 'bridge selected'
GROUP BY ce.conference_id
) AS first_event ON c.conference_id = first_event.conference_id
LEFT JOIN LEFT JOIN
conference_events ce ON c.conference_id = ce.conference_id conference_events ce ON c.conference_id = ce.conference_id
WHERE WHERE
(ce.time >= '%s 00:00:00' AND ce.time <= '%s 23:59:59') (ce.time >= '%s 00:00:00' AND ce.time <= '%s 23:59:59')
AND ce.conference_event = 'conference created'", AND (ce.conference_event = 'conference created'
OR (ce.conference_event = 'bridge selected' AND ce.time = first_event.first_event_time)
)",
// search for a conference by its ID for a time period (if given) // search for a conference by its ID for a time period (if given)