FIX revert system_notification_histories[bug]

This commit is contained in:
jasder 2021-10-29 16:13:50 +08:00
parent 97ed641c63
commit ab2e1ffa0e
2 changed files with 5 additions and 0 deletions

View File

@ -17,4 +17,8 @@ class SystemNotification < ApplicationRecord
scope :is_top, lambda { where(is_top: true) }
def read_member?(user_id)
self.system_notification_histories.where(user_id: user_id).present? ? true : false
end
end

View File

@ -60,6 +60,7 @@ json.setting do
if @top_system_notification.present?
json.system_notification do
json.(@top_system_notification, :id, :subject, :sub_subject, :content)
json.is_read @top_system_notification.read_member?(current_user&.id)
end
else
json.system_notification nil