@ -615,6 +615,10 @@ class CoursesController < ApplicationController
end
defshow
#更新创建课程消息状态
create_course_messages=@course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?",User.current.id,'Course',@course.id,0)
no_evaluation=CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?",User.current.id,@homework.course,"NoEvaluation",0)
@ -128,12 +128,12 @@ class UsersController < ApplicationController
#课程相关消息
when'homework'
@message_alls=CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage') and user_id =?",@user).order("created_at desc")
@message_alls=CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','NoEvaluation') and user_id =?",@user).order("created_at desc")
when'course_message'
@message_alls=CourseMessage.where("course_message_type =? and user_id =?","Message",@user).order("created_at desc")
when'course_news'
# 课程通知包含发布的通知和回复的通知
@message_alls=CourseMessage.where("course_message_type =? or course_message_type =?","News","Comment").where("user_id =?",@user).order("created_at desc")
@message_alls=CourseMessage.where("course_message_type in (?, ? ,?)","News","Comment","Course").where("user_id =?",@user).order("created_at desc")
when'poll'
@message_alls=CourseMessage.where("course_message_type =? and user_id =?","Poll",@user).order("created_at desc")
@ -145,7 +145,7 @@ class UsersController < ApplicationController
when'forge_news'
@message_alls=ForgeMessage.where("forge_message_type in (?,?) and user_id =?","News","Comment",@user).order("created_at desc")
when'apply'
@message_alls=ForgeMessage.where("forge_message_type in ('ProjectInvite', 'AppliedProject') and user_id =?",@user).order("created_at desc")
@message_alls=ForgeMessage.where("forge_message_type in ('ProjectInvite', 'AppliedProject', 'JoinProject', 'RemoveFromProject') and user_id =?",@user).order("created_at desc")