Update summary by state to include only booked in or waiting list people
This commit is contained in:
@@ -58,8 +58,6 @@ function booking_report_summary() {
|
||||
$header[] = array('data' => t('Refund Due'), 'field' => 'booking_refund_due');
|
||||
$header[] = array('data' => t('Welfare Required?'), 'field' => 'booking_welfare_required');
|
||||
$header[] = array('data' => t('Committee?'), 'field' => 'booking_committee_member');
|
||||
|
||||
|
||||
$rows = array();
|
||||
$state_header = array('State', 'Count');
|
||||
$state_rows = array();
|
||||
@@ -69,8 +67,14 @@ function booking_report_summary() {
|
||||
//do some analysis about the people booked in
|
||||
//first the summary of states
|
||||
$query = db_select('booking_person', 'p')
|
||||
->fields('p', array('booking_state', 'booking_country'))
|
||||
->condition('p.booking_event_id', $event->eid, '=');
|
||||
->fields('p', array('booking_state', 'booking_country'));
|
||||
|
||||
$db_or = db_or();
|
||||
$db_or->condition('p.booking_status', 1, '=');
|
||||
$db_or->condition('p.booking_status', 2, '=');
|
||||
$db_and = db_and()->condition($db_or)->condition('p.booking_event_id', $event->eid, '=');
|
||||
$query->condition($db_and);
|
||||
|
||||
$query->groupBy('p.booking_state');
|
||||
$query->addExpression('COUNT(p.booking_state)', 'state_count');
|
||||
$query->orderBy('state_count', 'DESC');
|
||||
|
Reference in New Issue
Block a user