Commit 61d5dc8a by Jansa Jose

changes in booking apis in api model

parent f635b733
...@@ -381,12 +381,12 @@ class Api_model extends CI_Model { ...@@ -381,12 +381,12 @@ class Api_model extends CI_Model {
$bookedData = $this->db->query(" $bookedData = $this->db->query("
SELECT ODR.order_id,ODR.order_type,ODR.booking_id FROM orders AS ODR SELECT ODR.order_id,ODR.order_type,ODR.booking_id FROM orders AS ODR
LEFT JOIN booking AS BOK ON LEFT JOIN booking AS BOK ON (ODR.booking_id=BOK.bookId AND
(ODR.booking_id=BOK.bookId AND BOK.status IN (0,1,2,3,5,6)) BOK.status IN (0,1,2,3,5,6))
LEFT JOIN flight_booking AS FBK ON LEFT JOIN flight_booking AS FBK ON (ODR.booking_id=FBK.flight_book_id AND
(ODR.booking_id=FBK.flight_book_id AND FBK.status IN (0,1,2,3,5)) FBK.status IN (0,1,2,3,5))
LEFT JOIN hotel_booking AS HBK ON LEFT JOIN hotel_booking AS HBK ON (ODR.booking_id=HBK.hotel_book_id AND
(ODR.booking_id=HBK.hotel_book_id AND HBK.status IN (0,1,2,3,5)) HBK.status IN (0,1,2,3,5))
WHERE ODR.customer_id='$user_id' WHERE ODR.customer_id='$user_id'
GROUP BY ODR.order_id ORDER BY ODR.order_id DESC $cond"); GROUP BY ODR.order_id ORDER BY ODR.order_id DESC $cond");
if($per_page == 0 && $page == 0){ if($per_page == 0 && $page == 0){
...@@ -445,6 +445,7 @@ class Api_model extends CI_Model { ...@@ -445,6 +445,7 @@ class Api_model extends CI_Model {
WHERE booking.bookId='$booking_id'"; WHERE booking.bookId='$booking_id'";
$eventData = $this->db->query($sql)->row_array(); $eventData = $this->db->query($sql)->row_array();
$eventData['order_type'] = 1;
$evtLang = langTranslator($eventData['event_id'],'EVT'); $evtLang = langTranslator($eventData['event_id'],'EVT');
array_merge($eventData,$evtLang); array_merge($eventData,$evtLang);
...@@ -471,6 +472,7 @@ class Api_model extends CI_Model { ...@@ -471,6 +472,7 @@ class Api_model extends CI_Model {
$hotelData['event_time'] = '11:00'; $hotelData['event_time'] = '11:00';
$hotelData['book_id'] = $hotelData['event_id']; $hotelData['book_id'] = $hotelData['event_id'];
$hotelData['venue_id'] = $hotelData['event_id']; $hotelData['venue_id'] = $hotelData['event_id'];
$hotelData['order_type'] = 2;
$hotelData['has_payment'] = 1; $hotelData['has_payment'] = 1;
unset($hotelData['traveller_details']); unset($hotelData['traveller_details']);
return $hotelData; return $hotelData;
...@@ -496,6 +498,7 @@ class Api_model extends CI_Model { ...@@ -496,6 +498,7 @@ class Api_model extends CI_Model {
unset($flightData['traveller_details'],$flightData['event_date']); unset($flightData['traveller_details'],$flightData['event_date']);
$flightData['event_date'] = (isset($fghtTme[0]) && !empty($fghtTme[0]))?$fghtTme[0]:''; $flightData['event_date'] = (isset($fghtTme[0]) && !empty($fghtTme[0]))?$fghtTme[0]:'';
$flightData['event_time'] = (isset($fghtTme[1]) && !empty($fghtTme[1]))?$fghtTme[1]:''; $flightData['event_time'] = (isset($fghtTme[1]) && !empty($fghtTme[1]))?$fghtTme[1]:'';
$flightData['order_type'] = 3;
$flightData['has_payment'] = 1; $flightData['has_payment'] = 1;
$flightData['book_id'] = $flightData['event_id']; $flightData['book_id'] = $flightData['event_id'];
$flightData['venue_id'] = $flightData['event_id']; $flightData['venue_id'] = $flightData['event_id'];
...@@ -581,7 +584,7 @@ class Api_model extends CI_Model { ...@@ -581,7 +584,7 @@ class Api_model extends CI_Model {
} }
} catch(Exception $e) { } catch(Exception $e) {
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); $res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06');
} }
return $res; return $res;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment