@@ -1774,7 +1774,11 @@ class Webservice_model extends CI_Model {
...
@@ -1774,7 +1774,11 @@ class Webservice_model extends CI_Model {
$phNumbers.=" phone LIKE '%".$number."' ".$eCond;
$phNumbers.=" phone LIKE '%".$number."' ".$eCond;
}
}
}
}
$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'))");
LEFT JOIN chats AS CHT ON ((CUST.customer_id=CHT.from_user OR CUST.customer_id=CHT.to_user) AND CHT.type=1)
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'))");
@@ -1828,11 +1835,20 @@ class Webservice_model extends CI_Model {
...
@@ -1828,11 +1835,20 @@ class Webservice_model extends CI_Model {
$result=$this->db->query("SELECT from_user,to_user,type FROM chats WHERE (from_user=$user_id OR to_user=$user_id) AND type IN('0','1')")->result_array();
$result=$this->db->query("SELECT from_user,to_user,type FROM chats WHERE (from_user=$user_id OR to_user=$user_id) AND type IN('0','1')")->result_array();