revert db query optimise
This commit is contained in:
@@ -243,6 +243,10 @@ function _booking_get_waitinglist()
|
||||
{
|
||||
global $event;
|
||||
|
||||
// This query doesn't work once someone on the waiting list has paid a deposit then a balance payment
|
||||
// Since there are multiple results in the booking_payment table
|
||||
// And only the most recent is returned
|
||||
/*
|
||||
//get a list of everyone on the waiting list
|
||||
$db_or = db_or();
|
||||
$db_or->condition('p.booking_status', 2, '=');
|
||||
@@ -252,7 +256,7 @@ function _booking_get_waitinglist()
|
||||
$db_and->condition('p.booking_eventid', $event->eid, '=');
|
||||
$db_and->condition($db_or);
|
||||
|
||||
$query = db_select('booking_person', 'p');
|
||||
$query = db_select('booking_person', 'p')->distinct();
|
||||
$query->join('booking_payment', 'y', 'p.nid = y.booking_person_nid');
|
||||
$query->condition($db_and)
|
||||
->fields('p', array('nid', 'booking_firstname', 'booking_lastname', 'booking_state', 'booking_readinggroup', 'booking_country', 'booking_status'))
|
||||
@@ -261,7 +265,9 @@ function _booking_get_waitinglist()
|
||||
$definition_result = $query->execute();
|
||||
|
||||
watchdog('booking_debug', "<pre>_booking_get_waitinglist\n@info</pre>", array('@info' => print_r($definition_result->queryString, true)));
|
||||
/*
|
||||
return $definition_result;
|
||||
*/
|
||||
|
||||
// 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
|
||||
FROM (
|
||||
@@ -273,8 +279,6 @@ function _booking_get_waitinglist()
|
||||
array(':eid' => $event->eid));
|
||||
|
||||
return $result;
|
||||
*/
|
||||
return $definition_result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user