Commit c3ceb558 by Jansa Jose

get_mechanics api

parent b6bfc0dc
...@@ -1151,11 +1151,13 @@ ...@@ -1151,11 +1151,13 @@
} }
$err = 0; $err = 0;
if((!isset($postdata['is_emergency']) || $postdata['is_emergency'] != 1) && if(!isset($postData['is_emergency']) || $postData['is_emergency'] != 1){
(!isset($postData['service_id']) || empty($postData['service_id']))){ if(!isset($postData['service_id']) || empty($postData['service_id'])){
$err = 1; $err = 1;
$msg = 'Service Id is Required'; $msg = 'Service Id is Required';
} }
}
else if(!isset($postData['location']) || empty($postData['location'])){ else if(!isset($postData['location']) || empty($postData['location'])){
$err = 1; $err = 1;
$msg = 'Location is Required'; $msg = 'Location is Required';
......
...@@ -392,7 +392,7 @@ class Webservice_model extends CI_Model { ...@@ -392,7 +392,7 @@ class Webservice_model extends CI_Model {
} }
$current_lat = $postData['location_lat']; $current_lat = $postData['location_lat'];
$current_lng = $postData['location_lng']; $current_lng = $postData['location_lng'];
$issue_cat_id = $postData['service_id']; $issue_cat_id = (isset($postData['is_emergency']) && $postData['is_emergency'] == 1)?'':$postData['service_id'];
if($start != 0 || $per_page != 0){ if($start != 0 || $per_page != 0){
$limt = "limit ".$start.",".$per_page; $limt = "limit ".$start.",".$per_page;
}else{ }else{
...@@ -413,7 +413,7 @@ class Webservice_model extends CI_Model { ...@@ -413,7 +413,7 @@ class Webservice_model extends CI_Model {
if(empty($mechData) || empty($mechData = $mechData->result_array())){ if(empty($mechData) || empty($mechData = $mechData->result_array())){
return 0; return 0;
} }
if($type == 0){ if($type == 0){
$respArr = $this->getNearMechanicsDetails($mechData,$issue_cat_id); $respArr = $this->getNearMechanicsDetails($mechData,$issue_cat_id);
if($respArr['status'] == 'success'){ if($respArr['status'] == 'success'){
......
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