rewrite waiting list query
This commit is contained in:
@@ -243,6 +243,25 @@ function _booking_get_waitinglist()
|
|||||||
{
|
{
|
||||||
global $event;
|
global $event;
|
||||||
|
|
||||||
|
//get a list of everyone on the waiting list
|
||||||
|
$db_or = db_or();
|
||||||
|
$db_or->condition('p.booking_status', 2, '=');
|
||||||
|
$db_or->condition('p.booking_status', 4, '=');
|
||||||
|
|
||||||
|
$db_and = db_and();
|
||||||
|
$db_and->condition('p.booking_eventid', $event->eid, '=');
|
||||||
|
$db_and->condition($db_or);
|
||||||
|
|
||||||
|
$query = db_select('booking_person', 'p');
|
||||||
|
$query->join('booking_payment', 'y', 'p.nid = y.booking_person_nid');
|
||||||
|
$query->condition($db_and)
|
||||||
|
->fields('p')
|
||||||
|
->fields('y')
|
||||||
|
->orderBy('p.booking_status')->orderBy('p.booking_payment_date');
|
||||||
|
$definition_result = $query->execute();
|
||||||
|
|
||||||
|
watchdog('booking_debug', "<pre>_booking_get_waitinglist\n@info</pre>", array('@info' => print_r( $definition_result, true)));
|
||||||
|
/*
|
||||||
// Taken from the Waiting List page, not very optimised
|
// Taken from the Waiting List page, not very optimised
|
||||||
$result = db_query('SELECT DISTINCT nid, booking_firstname, booking_lastname, booking_state, booking_readinggroup, booking_country, booking_status
|
$result = db_query('SELECT DISTINCT nid, booking_firstname, booking_lastname, booking_state, booking_readinggroup, booking_country, booking_status
|
||||||
FROM (
|
FROM (
|
||||||
@@ -254,6 +273,8 @@ function _booking_get_waitinglist()
|
|||||||
array(':eid' => $event->eid));
|
array(':eid' => $event->eid));
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
*/
|
||||||
|
return $definition_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user