Commit e940d38e by Jansa Jose

get booking summary api

parent ac8adb32
......@@ -309,13 +309,15 @@ class Webservice_model extends CI_Model {
$respArr['message'] = 'Booking Id is required';
return $respArr;
}
$this->db->select("customer_vehicle.car_model as vehicle_model,customer_vehicle.car_maker as vehicle_make,customer_vehicle.car_model_year as vehicle_year,customer_vehicle.vehicle_data,bookings.mileage,bookings.issues_selected,bookings.custom_issue_data,bookings.mechanic_id");
$this->db->select("customer_vehicle.car_model as vehicle_model,customer_vehicle.car_maker as vehicle_make,customer_vehicle.car_model_year as vehicle_year,customer_vehicle.vehicle_data,bookings.mileage,bookings.issues_selected,bookings.custom_issue_data,mechanic_booking.mechanic_id");
$this->db->join('customer_vehicle','customer_vehicle.customer_veh_id = bookings.customer_veh_id');
$mech_data = $this->db->get_where('bookings',array('booking_id'=>$postData['booking_id']));
$this->db->join("mechanic_booking","mechanic_booking.booking_id = bookings.booking_id AND mechanic_booking.status = '1'",'left');
$mech_data = $this->db->get_where('bookings',array('bookings.booking_id'=>$postData['booking_id']));
if(!empty($mech_data) && !empty($mechanic_data = $mech_data->row_array())){
$mech_veh_data = json_decode($mechanic_data['vehicle_data']);
$mechanic_data['engine_no'] = $mech_veh_data->attributes->Engine;
$mechanic_data['vehicle_trim'] = $mech_veh_data->attributes->Trim;
$mechanic_data['engine_no'] = !empty($mech_veh_data->attributes->Engine)?$mech_veh_data->attributes->Engine:'';
$mechanic_data['vehicle_trim'] = !empty($mech_veh_data->attributes->Trim)?$mech_veh_data->attributes->Trim:'';
unset($mechanic_data['vehicle_data']);
$mechanic_data['services'] = json_decode($mechanic_data['issues_selected']);
if(!empty($mechanic_data['services'])){
......
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