FIX revert system_notification_histories[bug]
This commit is contained in:
parent
97ed641c63
commit
ab2e1ffa0e
|
@ -17,4 +17,8 @@ class SystemNotification < ApplicationRecord
|
||||||
|
|
||||||
scope :is_top, lambda { where(is_top: true) }
|
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
|
end
|
||||||
|
|
|
@ -60,6 +60,7 @@ json.setting do
|
||||||
if @top_system_notification.present?
|
if @top_system_notification.present?
|
||||||
json.system_notification do
|
json.system_notification do
|
||||||
json.(@top_system_notification, :id, :subject, :sub_subject, :content)
|
json.(@top_system_notification, :id, :subject, :sub_subject, :content)
|
||||||
|
json.is_read @top_system_notification.read_member?(current_user&.id)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
json.system_notification nil
|
json.system_notification nil
|
||||||
|
|
Loading…
Reference in New Issue