Commit afa7d736 by Jansa Jose

dc

parent 7f7a3ef5
...@@ -456,8 +456,6 @@ class Webservice_model extends CI_Model { ...@@ -456,8 +456,6 @@ class Webservice_model extends CI_Model {
foreach ($mechData as $key => $value) { foreach ($mechData as $key => $value) {
$mechData[$key]['distance'] = round((float)$value['distance'],2); $mechData[$key]['distance'] = round((float)$value['distance'],2);
$mechData[$key]['review'] = []; $mechData[$key]['review'] = [];
$mechData[$key]['total_review'] = 0;
$mechData[$key]['avg_rate'] = 0;
$this->db->order_by('id','DESC'); $this->db->order_by('id','DESC');
$this->db->limit('2','0'); $this->db->limit('2','0');
...@@ -469,8 +467,8 @@ class Webservice_model extends CI_Model { ...@@ -469,8 +467,8 @@ class Webservice_model extends CI_Model {
FROM mechanic_rating FROM mechanic_rating
WHERE mechanic_id='".$value['mechanic_id']."'"); WHERE mechanic_id='".$value['mechanic_id']."'");
if(!empty($rating) && !empty($rating = $rating->row_array())){ if(!empty($rating) && !empty($rating = $rating->row_array())){
$mechData[$key]['total_review'] =$rating['count']; $mechData[$key]['total_review'] =(empty($rating['count']))?'0':;
$mechData[$key]['avg_rate'] = $rating['rating']; $mechData[$key]['avg_rate'] = (empty($rating['rating']))?0:(int)$rating['rating'];
} }
} }
if($type == 0){ if($type == 0){
......
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