SHARE
TWEET

Untitled

a guest Apr 26th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 在會員中心中,增加一「通知」分頁
  2. 1 表格中主要分為 3 個欄位,分別為,勾選、名稱、時間和分類 (縮圖 暫時不提供)
  3. 2 勾選:可以根據使用者需求,將項目勾選為已讀、未讀
  4. 3 名稱:顯示該通知名稱,文字包含其超連結 (如果有的話),點擊連結,則開啟至該頁面並且標記為已讀
  5. 4 分類:如果有圖示則顯示圖示,沒有圖示則顯示該分類的縮圖
  6. 5 會增加一個「標記全部已讀」的按鈕,將全部通知標記為通知
  7.  
  8. CREATE TABLE `member_notifications` (
  9.   `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '流水號',
  10.   `message` text COLLATE utf8_unicode_ci NOT NULL COMMENT '通知訊息',
  11.   `link` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '訊息連結',
  12.   `message_type` smallint(5) unsigned DEFAULT NULL COMMENT '訊息類型',
  13.   `start_at` timestamp NULL DEFAULT NULL COMMENT '開始通知時間',
  14.   `end_at` timestamp NULL DEFAULT NULL COMMENT '結束通知時間',
  15.   `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  16.   `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  17.   `deleted_at` timestamp NULL DEFAULT NULL,
  18.   PRIMARY KEY (`id`)
  19. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  20.  
  21. CREATE TABLE `member_notification_status` (
  22.   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  23.   `member_id` int(10) unsigned NOT NULL COMMENT '會員編號',
  24.   `read_notification_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '已讀的訊息編號',
  25.   `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  26.   `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  27.   `deleted_at` timestamp NULL DEFAULT NULL,
  28.   PRIMARY KEY (`id`),
  29.   UNIQUE KEY `read_notification_id` (`member_id`),
  30.   CONSTRAINT `member_notification_status_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `members` (`memberId`) ON DELETE CASCADE ON UPDATE CASCADE
  31. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top