Commit 7a284506 by Jansa Jose

change in single search webservice

parent a75c836c
...@@ -729,13 +729,16 @@ class Webservice_model extends CI_Model { ...@@ -729,13 +729,16 @@ class Webservice_model extends CI_Model {
} }
public function getReviewCount($product_id,$start,$per_page){ public function getReviewCount($product_id,$start,$per_page){
$this->db->select("PRD.*,TRIM(CONCAT(CUST.first_name,' ',IFNULL(CUST.last_name,''))) as customer_name"); $this->db->select("PRD.*,TRIM(CONCAT(CUST.first_name,' ',IFNULL(CUST.last_name,''))) as customer_name,CUST.profile_image");
$this->db->join('customers CUST','CUST.customer_id = PRD.customer_id'); $this->db->join('customers CUST','CUST.customer_id = PRD.customer_id');
$this->db->order_by('PRD.id DESC'); $this->db->order_by('PRD.id DESC');
if($start != 0 || $per_page != 0){ if($start != 0 || $per_page != 0){
$this->db->limit($per_page,$start); $this->db->limit($per_page,$start);
} }
$reviews = $this->db->get_where('product_rating PRD',array('PRD.product_id'=>$product_id,'PRD.status'=>'1'))->result(); $reviews = $this->db->get_where('product_rating PRD',array('PRD.product_id'=>$product_id,'PRD.status'=>'1'))->result();
foreach ($reviews as $key => $value) {
$reviews[$key]->rating = (float)$value->rating;
}
return $reviews; return $reviews;
} }
......
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