Commit ffb399d3 by Tobin

daily commit

parent d4ba340f
...@@ -210,12 +210,11 @@ class Webservices extends CI_Controller { ...@@ -210,12 +210,11 @@ class Webservices extends CI_Controller {
$mechanic_data = $this->Mechanic_model->getNearByMechanics($postData); $mechanic_data = $this->Mechanic_model->getNearByMechanics($postData);
if(!empty($issue_data)){ if(!empty($mechanic_data)){
$respArr['status'] = '1'; $respArr['status'] = '1';
$respArr['message'] = 'Success'; $respArr['message'] = 'Success';
$respArr['mechanic_data'] = $mechanic_data; $respArr['mechanic_data'] = $mechanic_data;
} }
echo json_encode($respArr); exit; echo json_encode($respArr); exit;
} }
} }
......
...@@ -141,7 +141,7 @@ class Mechanic_model extends CI_Model { ...@@ -141,7 +141,7 @@ class Mechanic_model extends CI_Model {
$current_lat = $pickLocData['pickup_lat']; $current_lat = $pickLocData['pickup_lat'];
$current_lng = $pickLocData['pickup_lng']; $current_lng = $pickLocData['pickup_lng'];
$sql = "SELECT ME.*,MS.shop_name,MS.address AS shop_address, $sql = "SELECT AU.display_name,AU.profile_image,ME.*,MS.shop_name,MS.address AS shop_address,
MS.phone AS shop_phone,MS.email_id AS shop_email_id, MS.phone AS shop_phone,MS.email_id AS shop_email_id,
3956*2*ASIN(SQRT(POWER(SIN(($current_lat-ME.location_lat)*pi()/180/2),2)+ 3956*2*ASIN(SQRT(POWER(SIN(($current_lat-ME.location_lat)*pi()/180/2),2)+
COS($current_lat*pi()/180 )*COS(ME.location_lat*pi()/180)* COS($current_lat*pi()/180 )*COS(ME.location_lat*pi()/180)*
...@@ -158,19 +158,20 @@ class Mechanic_model extends CI_Model { ...@@ -158,19 +158,20 @@ class Mechanic_model extends CI_Model {
} }
$mechDataArr = array(); $mechDataArr = array();
$default_timer = array('09:00 AM','10:00 AM','11:00 AM','12:00 PM','01:00 PM','02:00 PM','03:00 PM','04:00 PM','05:00 PM','06:00 PM'); foreach($mechData AS $index => $data){
foreach($mechData AS $data){
if(empty($data['start_time']) || empty($data['end_time'])){ if(empty($data['start_time']) || empty($data['end_time'])){
continue; $scheduleTiming = array('09:00 AM','10:00 AM','11:00 AM','12:00 PM','01:00 PM',
} '02:00 PM','03:00 PM','04:00 PM','05:00 PM','06:00 PM');
} else {
$endTime = strtotime($data['end_time']); $endTime = strtotime($data['end_time']);
$schTime = strtotime($data['start_time']); $schTime = strtotime($data['start_time']);
$custom_timer = array(); $scheduleTiming = array();
for( ; $schTime <= $endTime ; $schTime += 3600){ for( ; $schTime <= ($endTime-3600) ; $schTime += 3600){
$custom_timer[] = $schTime; $scheduleTiming[] = date('h:i A',$schTime);
}
} }
pr($custom_timer); $mechData[$index]['scheduleTiming'] = $scheduleTiming;
} }
return $mechData; return $mechData;
} }
......
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