Commit 2108465f by Jansa Jose

get allocated service

parent fdb8ab00
......@@ -162,16 +162,16 @@ class Webservice_model extends CI_Model {
}
$where = ($type == 1)?array('bookings.booking_id'=>$id):array('bookings.customer_id'=>$id);
$bookDetails = '';
if($type == 1){
$bookDetails = ",mechanic.location,mechanic.location_lat,mechanic.location_lng";
}
//if($type == 1){
// $bookDetails = ",mechanic.location,mechanic.location_lat,mechanic.location_lng";
//}
$this->db->select("bookings.booking_id as id,bookings.scheduled_date as booked_date,bookings.scheduled_time as time,customer_vehicle.vehicle_data,customer_vehicle.customer_veh_id as vehicle_id,customer_vehicle.car_model_year as year,customer_vehicle.car_maker as vehcle_make,customer_vehicle.car_model as vehicle_type,bookings.mileage,
bookings.service_type as is_emergency,bookings.status as service_status,bookings.issues_selected,bookings.custom_issue_data".$bookDetails);
bookings.service_type as is_emergency,bookings.status as service_status,bookings.issues_selected,bookings.custom_issue_data,mechanic.location,mechanic.location_lat,mechanic.location_lng,mechanic_booking.amount");
$this->db->join('customer_vehicle','customer_vehicle.customer_veh_id = bookings.customer_veh_id');
if($type == 1){
//if($type == 1){
$this->db->join("mechanic_booking","mechanic_booking.booking_id = bookings.booking_id AND mechanic_booking.status='1'");
$this->db->join("mechanic","mechanic_booking.mechanic_id = mechanic.mechanic_id");
}
//}
$this->db->where('scheduled_date >',date('Y-m-d h:i'));
if($start != 0 || $per_page != 0){
$this->db->limit($per_page,$start);
......
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