Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 在會員中心中,增加一「通知」分頁
- 1 表格中主要分為 3 個欄位,分別為,勾選、名稱、時間和分類 (縮圖 暫時不提供)
- 2 勾選:可以根據使用者需求,將項目勾選為已讀、未讀
- 3 名稱:顯示該通知名稱,文字包含其超連結 (如果有的話),點擊連結,則開啟至該頁面並且標記為已讀
- 4 分類:如果有圖示則顯示圖示,沒有圖示則顯示該分類的縮圖
- 5 會增加一個「標記全部已讀」的按鈕,將全部通知標記為通知
- CREATE TABLE `member_notifications` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '流水號',
- `message` text COLLATE utf8_unicode_ci NOT NULL COMMENT '通知訊息',
- `link` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '訊息連結',
- `message_type` smallint(5) unsigned DEFAULT NULL COMMENT '訊息類型',
- `start_at` timestamp NULL DEFAULT NULL COMMENT '開始通知時間',
- `end_at` timestamp NULL DEFAULT NULL COMMENT '結束通知時間',
- `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `deleted_at` timestamp NULL DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
- CREATE TABLE `member_notification_status` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `member_id` int(10) unsigned NOT NULL COMMENT '會員編號',
- `read_notification_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '已讀的訊息編號',
- `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `deleted_at` timestamp NULL DEFAULT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `read_notification_id` (`member_id`),
- CONSTRAINT `member_notification_status_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `members` (`memberId`) ON DELETE CASCADE ON UPDATE CASCADE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement