Make it easier to see leaders and helpers in studygroup lists

This commit is contained in:
2014-06-27 15:06:19 +10:00
parent 57b9b065df
commit 53ea1fd2fe
4 changed files with 54 additions and 44 deletions

View File

@@ -136,6 +136,21 @@ function _booking_get_waitinglist_top()
watchdog('booking', "First person on the waiting list: @info", array('@info' => var_export($person, TRUE)));
return $person->nid;
}
//in case there's no people with status waiting list, but there is some with missed payment deadline
$result = db_query('SELECT p.nid, p.booking_firstname, p.booking_lastname, pay.booking_payment_date
FROM {booking_person} p, {booking_payment} pay
WHERE booking_status = 4 and booking_event_id = :eid and p.nid = pay.booking_person_nid
ORDER BY pay.booking_payment_date
LIMIT 1',
array(':eid' => $event->eid));
foreach ($result as $person)
{
watchdog('booking', "First person on the missed-payment-deadline list: @info", array('@info' => var_export($person, TRUE)));
return $person->nid;
}
//in case there was no one on the waiting list
return -1;
}