Commit 726a7385 by Jansa Jose

dc

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