答案 0 :(得分:0)
您可以使用notifications_seen
,id
,user_id
等列创建新表notification_id
。当您想知道用户是否已经看过通知时,只需查询此表即可。当结果为0 rows
时,您可以显示通知。
$sql = "SELECT 1 FROM `notifications_seen` WHERE `user_id` = 1 AND `notification_id` = 13;
$result = $db->query($sql);
if($db->num($result) == 0)
{
// add code to view notification
// don't forget to to make an INSERT when the notification was seen
}