Commit 2d8ae721 by Jansa Jose

dc

parent d479462b
...@@ -461,7 +461,12 @@ class Webservice_model extends CI_Model { ...@@ -461,7 +461,12 @@ class Webservice_model extends CI_Model {
$mechRvw = $this->db->get_where('mechanic_rating',array('mechanic_id'=>$value['mechanic_id'],'status'=>'1')); $mechRvw = $this->db->get_where('mechanic_rating',array('mechanic_id'=>$value['mechanic_id'],'status'=>'1'));
if(!empty($mechRvw) && !empty($mechRvw = $mechRvw->result_array())){ if(!empty($mechRvw) && !empty($mechRvw = $mechRvw->result_array())){
$mechData[$key]['review'] = $mechRvw; $mechData[$key]['review'] = $mechRvw;
$mechData[$key]['total_review'] = count($mechRvw);
} }
$rating = $this->db->query("SELECT round(avg(rate),2) AS rating
FROM mechanic_rating
WHERE mechanic_id='".$value['mechanic_id']."'");
$mechData[$key]['avg_rate'] = (!empty($rating) && !empty($rating = $rating->row_array()))?$rating['rating']:'0';
} }
if($type == 0){ if($type == 0){
$respArr = $this->getNearMechanicsDetails($mechData,$issue_cat_id); $respArr = $this->getNearMechanicsDetails($mechData,$issue_cat_id);
......
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