add earlyaccess code to mysql view
This commit is contained in:
@@ -34,6 +34,12 @@ function _booking_node_create_mysqlview()
|
|||||||
$query = db_select('booking_person', 'p');
|
$query = db_select('booking_person', 'p');
|
||||||
//add price info
|
//add price info
|
||||||
$query->join('booking_price', 'pr', 'p.booking_payment_id = pr.pid');
|
$query->join('booking_price', 'pr', 'p.booking_payment_id = pr.pid');
|
||||||
|
|
||||||
|
//add the join for earlyaccess code if enabled
|
||||||
|
if (variable_get('booking_enable_earlyaccess_codes', 0) == 1) {
|
||||||
|
$query->leftJoin('booking_earlyaccess_codes', 'c', 'p.nid = c.booking_earlyaccess_code_nid');
|
||||||
|
}
|
||||||
|
|
||||||
//add travel form info if it exists
|
//add travel form info if it exists
|
||||||
$query->leftJoin('booking_travel', 't', 'p.nid = t.booking_person_nid');
|
$query->leftJoin('booking_travel', 't', 'p.nid = t.booking_person_nid');
|
||||||
|
|
||||||
@@ -66,6 +72,10 @@ function _booking_node_create_mysqlview()
|
|||||||
->fields('t')
|
->fields('t')
|
||||||
->fields('pr', array('booking_price', 'booking_price_descrip','booking_late_price'));
|
->fields('pr', array('booking_price', 'booking_price_descrip','booking_late_price'));
|
||||||
|
|
||||||
|
if (variable_get('booking_enable_earlyaccess_codes', 0) == 1) {
|
||||||
|
$query->fields('c', array('cid', 'booking_earlyaccess_code'));
|
||||||
|
}
|
||||||
|
|
||||||
if (variable_get('booking_enable_roomallocations', 0) == 1) {
|
if (variable_get('booking_enable_roomallocations', 0) == 1) {
|
||||||
$query->fields('rm', array('booking_room_bedtype'))
|
$query->fields('rm', array('booking_room_bedtype'))
|
||||||
->fields('r', array('rid', 'booking_room_location_id', 'booking_room_number'))
|
->fields('r', array('rid', 'booking_room_location_id', 'booking_room_number'))
|
||||||
|
Reference in New Issue
Block a user