update mysql view for variety session registration ids

This commit is contained in:
Nathan Coad
2018-05-03 08:53:10 +10:00
parent 59cbcb9c52
commit 2521a6fd96
3 changed files with 20 additions and 1 deletions

View File

@@ -72,6 +72,11 @@ function _booking_node_create_mysqlview()
}
}
//add the joins for variety session info if enabled
if (variable_get('booking_enable_variety_sessions', 0) == 1) {
$query->leftJoin('booking_variety_regn', 'v', 'p.nid = v.booking_person_nid');
}
//filter the results either by current active event
// @todo is this filter really necessary?
$query->condition('p.booking_eventid', $event->eid, '=');
@@ -102,6 +107,11 @@ function _booking_node_create_mysqlview()
}
}
//add field for variety session registrations if enabled
if (variable_get('booking_enable_variety_sessions', 0) == 1) {
$query->fields('v', array('booking_variety_ids'));
}
//now that we have built the query as a SelectObject, turn it into a string we can use to create a view
$querystring=$query->__toString();
$querystring=str_replace("{",'',$querystring);