Commit 84ca790e by Jansa Jose

Merge branch 'master' into 'dev_production'

dc See merge request !194
parents aa0bd8d4 3f02efd5
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
header('Content-type: application/json'); header('Content-type: application/json');
$post = file_get_contents("php://input"); $post = file_get_contents("php://input");
$postData = json_decode($post, true); $postData = json_decode($post, true);
//pr($postData);
$this->load->model('Customer_model'); $this->load->model('Customer_model');
$respArr = array('status'=>'0','message'=>'Required Fields are empty.'); $respArr = array('status'=>'0','message'=>'Required Fields are empty.');
if(!isset($postData['email']) || empty($postData['email']) || if(!isset($postData['email']) || empty($postData['email']) ||
...@@ -423,6 +424,7 @@ ...@@ -423,6 +424,7 @@
} }
echo json_encode($respArr);exit; echo json_encode($respArr);exit;
} }
// addCustomerCar // addCustomerCar
public function addCustomerCar(){ public function addCustomerCar(){
header('Content-type: application/json'); header('Content-type: application/json');
......
...@@ -162,7 +162,7 @@ class Mechanic_model extends CI_Model { ...@@ -162,7 +162,7 @@ class Mechanic_model extends CI_Model {
LEFT JOIN mechanic_shop AS MS ON (MS.shop_id=ME.shop_id AND MS.status='1') LEFT JOIN mechanic_shop AS MS ON (MS.shop_id=ME.shop_id AND MS.status='1')
WHERE AU.status='1' WHERE AU.status='1'
-- GROUP BY ME.mechanic_id -- GROUP BY ME.mechanic_id
-- HAVING distance<30"; HAVING distance<10";
$mechData = $this->db->query($sql); $mechData = $this->db->query($sql);
if(empty($mechData) || empty($mechData = $mechData->result_array())){ if(empty($mechData) || empty($mechData = $mechData->result_array())){
......
...@@ -82,7 +82,7 @@ public function getBookedService($postData = array(),$start = '',$per_page = '', ...@@ -82,7 +82,7 @@ public function getBookedService($postData = array(),$start = '',$per_page = '',
$this->db->order_by('BUK.scheduled_date','ASC'); $this->db->order_by('BUK.scheduled_date','ASC');
} }
$this->db->select("BUK.scheduled_date as date,BUK.scheduled_time as time,BUK.booking_id as service_id,BUK.status,CSTVEH.car_name,BUK.mileage,BUK.issues_selected,BUK.custom_issue_data,BUK.service_type as type,MCHBUK.amount,BUK.cost,TRIM(CONCAT(CUST.first_name,' ' ,IFNULL(CUST.last_name,''))) as customer_name,CUST.phone as phone_number,CSTVEH.vehicle_data,CSTVEH.car_loc_lat as cust_lat,CSTVEH.car_loc_lng as cust_lng,CSTVEH.car_location as cust_address"); $this->db->select("BUK.scheduled_date as date,BUK.scheduled_time as time,BUK.booking_id as service_id,BUK.status,CSTVEH.car_name,BUK.mileage,BUK.issues_selected,BUK.custom_issue_data,BUK.service_type as type,MCHBUK.amount,BUK.cost,TRIM(CONCAT(CUST.first_name,' ' ,IFNULL(CUST.last_name,''))) as customer_name,CUST.phone as phone_number,CSTVEH.vehicle_data,CSTVEH.car_loc_lat as cust_lat,CSTVEH.car_loc_lng as cust_lng,CSTVEH.car_location as cust_address,BUK.car_loc_lat,BUK.car_loc_lng,BUK.car_location");
$this->db->from('bookings as BUK'); $this->db->from('bookings as BUK');
$this->db->join('customers as CUST','CUST.customer_id = BUK.customer_id'); $this->db->join('customers as CUST','CUST.customer_id = BUK.customer_id');
$this->db->join('customer_vehicle as CSTVEH','CSTVEH.customer_veh_id = BUK.customer_veh_id'); $this->db->join('customer_vehicle as CSTVEH','CSTVEH.customer_veh_id = BUK.customer_veh_id');
...@@ -106,6 +106,14 @@ public function getBookedService($postData = array(),$start = '',$per_page = '', ...@@ -106,6 +106,14 @@ public function getBookedService($postData = array(),$start = '',$per_page = '',
$bookData[$key]['service_message'] = (isset($custom_issue_data->optionlaDescription))?$custom_issue_data->optionlaDescription:''; $bookData[$key]['service_message'] = (isset($custom_issue_data->optionlaDescription))?$custom_issue_data->optionlaDescription:'';
$bookData[$key]['total_amount'] = ($value['type'] == '1')?$value['amount']:$value['cost']; $bookData[$key]['total_amount'] = ($value['type'] == '1')?$value['amount']:$value['cost'];
unset($bookData[$key]['issues_selected'],$bookData[$key]['custom_issue_data'],$bookData[$key]['amount'],$bookData[$key]['cost']); unset($bookData[$key]['issues_selected'],$bookData[$key]['custom_issue_data'],$bookData[$key]['amount'],$bookData[$key]['cost']);
if($value['type'] == '2'){
// unset($bookData[$key]['cust_lat'],$bookData[$key]['cust_lng'],$bookData[$key]['cust_address']);
$bookData[$key]['cust_lat'] = $bookData[$key]['car_loc_lat'];
$bookData[$key]['cust_lng'] = $bookData[$key]['car_loc_lng'];
$bookData[$key]['cust_address'] = $bookData[$key]['car_location'];
}
unset($bookData[$key]['car_loc_lat'],$bookData[$key]['car_loc_lng'],$bookData[$key]['car_location']);
if(!empty($issues_selected)){ if(!empty($issues_selected)){
$new = array(); $new = array();
foreach ($issues_selected as $issue_key => $issue_value) { foreach ($issues_selected as $issue_key => $issue_value) {
......
...@@ -456,8 +456,8 @@ class Webservice_model extends CI_Model { ...@@ -456,8 +456,8 @@ class Webservice_model extends CI_Model {
FROM mechanic AS ME FROM mechanic AS ME
INNER JOIN admin_users AS AU ON (AU.id=ME.mechanic_id) INNER JOIN admin_users AS AU ON (AU.id=ME.mechanic_id)
LEFT JOIN mechanic_shop AS MS ON (MS.shop_id=ME.shop_id AND MS.status='1') LEFT JOIN mechanic_shop AS MS ON (MS.shop_id=ME.shop_id AND MS.status='1')
WHERE AU.status='1' WHERE AU.status='1'
-- HAVING distance<30 HAVING distance<10
".$limt; ".$limt;
$mechData = $this->db->query($sql); $mechData = $this->db->query($sql);
if(empty($mechData) || empty($mechData = $mechData->result_array())){ if(empty($mechData) || empty($mechData = $mechData->result_array())){
......
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