news消息已读修改
This commit is contained in:
parent
440cd04414
commit
47ca79c317
|
@ -108,15 +108,11 @@ class NewsController < ApplicationController
|
|||
def show
|
||||
# 更新news对应的forge_messages的消息viewed字段
|
||||
if @project
|
||||
query_message_news = @news.forge_messages
|
||||
query_message_news = ForgeMessage.where("forge_message_id =? and user_id =?", @news.id, User.current.id).first
|
||||
else
|
||||
query_message_news = @news.course_messages
|
||||
end
|
||||
query_message_news.each do |query|
|
||||
if User.current.id == query.user_id
|
||||
query.update_attributes(:viewed => true)
|
||||
end
|
||||
query_message_news = CourseMessage.where("course_message_id =? and user_id =?", @news.id, User.current.id).first
|
||||
end
|
||||
query_message_news.update_attribute(:viewed, true)
|
||||
# 更新项目新闻的评阅的消息viewed字段
|
||||
current_message_comments = @news.comments
|
||||
current_message_comments.each do |current_message_comment|
|
||||
|
|
Loading…
Reference in New Issue