improve query for person based on tempid

This commit is contained in:
Nathan Coad
2020-02-24 22:41:23 +11:00
parent b11ce79cd7
commit f79f298978

View File

@@ -21,14 +21,24 @@ function booking_balance_page() {
//TODO: if the person says they're married, query to see if they're listed partner has already registered and paid
//if they have, then let the new registration person know their partner has already paid, and send them the confirmation email
//work out the node id from the session id
$query = db_select('booking_person', 'p');
$db_and = db_and()->condition('p.booking_eventid', $event->eid, '=')
->condition('p.booking_tempid', arg(1), '=');
$query->condition($db_and);
$query->fields('p', array('nid'));
$person = $query->execute()
->fetchObject();
/*
$query = db_select('booking_person', 'p');
$query->condition('p.booking_tempid', arg(1), '=')
->fields('p', array('nid'));
$person = $query->execute()
->fetchObject();
*/
if ($person) {
//load all the fields
$node = node_load($person->nid);