Adds conference duration calculation

main
Yasen Pramatarov 2024-07-10 15:52:13 +03:00
parent e85e9c577f
commit 2496d3fc93
2 changed files with 10 additions and 2 deletions

View File

@ -14,14 +14,14 @@ SELECT DISTINCT
WHERE WHERE
ce.conference_id = c.conference_id ce.conference_id = c.conference_id
AND AND
ce.conference_event = 'conference expired') ce.conference_event = 'conference created')
AS start, AS start,
(SELECT ce.time (SELECT ce.time
FROM conference_events ce FROM conference_events ce
WHERE WHERE
ce.conference_id = c.conference_id ce.conference_id = c.conference_id
AND AND
ce.conference_event = 'conference created') ce.conference_event = 'conference expired')
AS end, AS end,
c.conference_id, c.conference_id,
c.conference_name, c.conference_name,

View File

@ -256,11 +256,19 @@ if (isset($conference_id)) {
foreach ($search as $item) { foreach ($search as $item) {
extract($item); extract($item);
// we don't have duration field, so we calculate it
if (!empty($start) && !empty($end)) {
$duration = gmdate("H:i:s", abs(strtotime($end) - strtotime($start)));
} else {
$duration = '';
}
$conference_record = array( $conference_record = array(
// assign title to the field in the array record // assign title to the field in the array record
'component' => $jitsi_component, 'component' => $jitsi_component,
'start' => $start, 'start' => $start,
'end' => $end, 'end' => $end,
'duration' => $duration,
'conference ID' => $conference_id, 'conference ID' => $conference_id,
'conference name' => $conference_name, 'conference name' => $conference_name,
'participants' => $participants, 'participants' => $participants,