Commit 06973ca7 by Jansa Jose

add mechanic shop name and mechanic rating

parent 8e4c965b
...@@ -162,10 +162,12 @@ class Webservice_model extends CI_Model { ...@@ -162,10 +162,12 @@ 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"); 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");
$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");
$this->db->join("mechanic_shop","mechanic_shop.shop_id = mechanic.shop_id","left");
$this->db->where('scheduled_date >',date('Y-m-d h:i')); $this->db->where('scheduled_date >',date('Y-m-d h:i'));
if($start != 0 || $per_page != 0){ if($start != 0 || $per_page != 0){
$this->db->limit($per_page,$start); $this->db->limit($per_page,$start);
...@@ -588,6 +590,10 @@ class Webservice_model extends CI_Model { ...@@ -588,6 +590,10 @@ class Webservice_model extends CI_Model {
$respArr['message'] = 'Description is Required'; $respArr['message'] = 'Description is Required';
return $respArr; return $respArr;
} }
if(empty($postData['title'])){
$respArr['message'] = 'Title is Required';
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 = $booked_data->row_array())){
$respArr['message'] = 'Sorry, You are already Rated for this mechanic'; $respArr['message'] = 'Sorry, You are already Rated for this mechanic';
......
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