Commit b8b13356 by Jansa Jose

customer Id

parent 365cebd2
...@@ -1773,12 +1773,11 @@ class Webservice_model extends CI_Model { ...@@ -1773,12 +1773,11 @@ class Webservice_model extends CI_Model {
} else { } else {
$phNumbers .= " phone LIKE '%".$number."' ".$eCond; $phNumbers .= " phone LIKE '%".$number."' ".$eCond;
} }
} }
$result = $this->db->query("SELECT name,phone,profile_image FROM customer WHERE (".$phNumbers.") AND customer_id NOT IN (SELECT from_user FROM chats WHERE (from_user=$user_id AND type='2') OR (to_user =$user_id AND type='2')) AND customer_id NOT IN (SELECT to_user FROM chats WHERE (from_user=$user_id AND type='2') OR (to_user =$user_id AND type='2'))"); $result = $this->db->query("SELECT customer_id,name,phone,profile_image FROM customer WHERE (".$phNumbers.") AND customer_id NOT IN (SELECT from_user FROM chats WHERE (from_user=$user_id AND type='2') OR (to_user =$user_id AND type='2')) AND customer_id NOT IN (SELECT to_user FROM chats WHERE (from_user=$user_id AND type='2') OR (to_user =$user_id AND type='2'))");
if(!empty($result) && !empty($result = $result->result_array())){ $respArr['status'] = 1;
$respArr['status'] = 1; if(!empty($result) && !empty($result = $result->result_array())){
$respArr['data'] = $result; $respArr['data'] = $result;
}else{ }else{
$respArr['message'] = 'No Data Found'; $respArr['message'] = 'No Data Found';
...@@ -1813,7 +1812,7 @@ class Webservice_model extends CI_Model { ...@@ -1813,7 +1812,7 @@ class Webservice_model extends CI_Model {
public function get_friend_requests($data){ public function get_friend_requests($data){
$respArr = array('status'=>0,'code'=>'918','message'=>'No Request for you'); $respArr = array('status'=>0,'code'=>'918','message'=>'No Request for you');
$user_id = $this->auth_token_get($data['auth_token']); $user_id = $this->auth_token_get($data['auth_token']);
$this->db->select("name,phone,profile_image"); $this->db->select("name,phone,profile_image,customer_id");
$this->db->join('customer','customer.customer_id = chats.to_user'); $this->db->join('customer','customer.customer_id = chats.to_user');
$result=$this->db->get_where('chats',array('to_user'=>$user_id,'type'=>'0'))->result_array(); $result=$this->db->get_where('chats',array('to_user'=>$user_id,'type'=>'0'))->result_array();
if(!empty($result)){ if(!empty($result)){
...@@ -1832,7 +1831,7 @@ class Webservice_model extends CI_Model { ...@@ -1832,7 +1831,7 @@ class Webservice_model extends CI_Model {
if($value['to_user'] == $user_id && $value['type'] == 0){ if($value['to_user'] == $user_id && $value['type'] == 0){
continue; continue;
} }
$this->db->select("name,phone,profile_image"); $this->db->select("name,phone,profile_image,customer_id");
$cust = $this->db->get_where('customer',array('customer_id'=>$value['to_user'])); $cust = $this->db->get_where('customer',array('customer_id'=>$value['to_user']));
if(!empty($cust) && !empty($cust = $cust->row_array())){ if(!empty($cust) && !empty($cust = $cust->row_array())){
$custData[] = $cust; $custData[] = $cust;
......
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