我正在处理好友请求和通知系统!当用户发送好友请求时,第二个用户收到通知!当第二个用户接受它时,通知表在did_read字段中更新为1。我试过了,但它向我显示了所有通知,包括read(did_read = 1)。请告诉我我的代码中的问题在哪里。谢谢
我的功能在
之下public function manage_friend_req($loginuser){
$this->db->select('from_user,to_user,did_read,avatar');
$this->db->from('notifications');
$this->db->join('users','users.username = notifications.from_user');
$this->db->where(array('notifications.to_user'=>$loginuser));
$this->db->where('notifications.did_read',0);
$query = $this->db->get();
return $query->result();
} // 'did_read' field in database is an enum.
答案 0 :(得分:0)