Commit bbabc3a9 by Jansa Jose

change in nearbymechanics api

parent 1d667a53
......@@ -198,6 +198,10 @@ class Mechanic_model extends CI_Model {
$scheduleTiming[] = $schTime * 1000;
}
}
if(empty($scheduleTiming)){
unset($mechData[$index]);
continue;
}
$rating = $this->db->query("SELECT round(avg(rate),2) AS rating
FROM mechanic_rating
......@@ -235,6 +239,7 @@ class Mechanic_model extends CI_Model {
$mechData[$index]['sub_issues'] = $sIssueData;
$mechData[$index]['scheduleTiming'] = $scheduleTiming;
}
$mechData = array_merge($mechData);
return $mechData;
}
}
......
......@@ -536,6 +536,11 @@ class Webservice_model extends CI_Model {
$scheduleTiming[] = date('h:i A',$schTime);
}
}
if(empty($scheduleTiming)){
unset($mechData[$index]);
continue;
}
// $rating = $this->db->query("SELECT round(avg(rate),2) AS rating
// FROM mechanic_rating
// WHERE mechanic_id='".$data['mechanic_id']."'");
......@@ -566,10 +571,11 @@ class Webservice_model extends CI_Model {
$mechData[$index]['estimate'] = $estimate;
$mechData[$index]['sub_issues'] = $sIssueData;
$mechData[$index]['scheduleTiming'] = $scheduleTiming;
$respArr['status'] = 'success';
$respArr['message'] = 'success';
$respArr['data'] = $mechData;
}
$mechData = array_merge($mechData);
$respArr['status'] = 'success';
$respArr['message'] = 'success';
$respArr['data'] = $mechData;
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