Commit c000a428 by Jansa Jose

get mechanics

parent 8879a8c3
...@@ -1273,7 +1273,7 @@ ...@@ -1273,7 +1273,7 @@
if($authRes['status'] == 'error'){ if($authRes['status'] == 'error'){
echo json_encode($authRes);exit; echo json_encode($authRes);exit;
} }
$postData['customer_id'] = $authRes['data']; $postData['customer_id'] = $authRes['data']['customer_id'];
$result = $this->Webservice_model->rate_mechanic($postData); $result = $this->Webservice_model->rate_mechanic($postData);
echo json_encode($result);exit; echo json_encode($result);exit;
} }
......
...@@ -163,7 +163,7 @@ class Webservice_model extends CI_Model { ...@@ -163,7 +163,7 @@ class Webservice_model extends CI_Model {
$where = ($type == 1)?array('bookings.booking_id'=>$id):array('bookings.customer_id'=>$id); $where = ($type == 1)?array('bookings.booking_id'=>$id):array('bookings.customer_id'=>$id);
$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, $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,mechanic.location,mechanic.location_lat,mechanic.location_lng,mechanic_booking.amount,bookings.cost,TRIM(concat(mechanic.first_name,' ',IFNULL(mechanic.last_name,''))) as mechanic_name,mechanic.address,mechanic.phone,mechanic.mechanic_id,mechanic_shop. 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,bookings.cost,TRIM(concat(mechanic.first_name,' ',IFNULL(mechanic.last_name,''))) as mechanic_name,mechanic.address,mechanic.phone,mechanic.mechanic_id,mechanic_shop.
shop_name"); shop_name,bookings.car_location as user_loc,bookings.car_loc_lat as user_lat,bookings.car_loc_lng as user_lng");
$this->db->join('customer_vehicle','customer_vehicle.customer_veh_id = bookings.customer_veh_id'); $this->db->join('customer_vehicle','customer_vehicle.customer_veh_id = bookings.customer_veh_id');
$this->db->join("mechanic_booking","mechanic_booking.booking_id = bookings.booking_id AND mechanic_booking.status='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->join("mechanic","mechanic_booking.mechanic_id = mechanic.mechanic_id");
...@@ -595,7 +595,7 @@ class Webservice_model extends CI_Model { ...@@ -595,7 +595,7 @@ class Webservice_model extends CI_Model {
return $respArr; return $respArr;
} }
$mechRate = $this->db->get_where('mechanic_rating',array('customer_id'=>$postData['customer_id'],'mechanic_id'=>$postData['mechanic_id'])); $mechRate = $this->db->get_where('mechanic_rating',array('customer_id'=>$postData['customer_id'],'mechanic_id'=>$postData['mechanic_id']));
if(!empty($mechRate) && !empty($mechRate = $booked_data->row_array())){ if(!empty($mechRate) && !empty($mechRate = $mechRate->row_array())){
$respArr['message'] = 'Sorry, You are already Rated for this mechanic'; $respArr['message'] = 'Sorry, You are already Rated for this mechanic';
return $respArr; return $respArr;
} }
......
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