From 586cde6f87c1d89fac58681b2449c7aa07ec73d9 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 26 Oct 2015 09:04:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E6=88=90=E4=B8=BA=E8=AF=BE=E7=A8=8B=E7=9A=84=E8=80=81?= =?UTF-8?q?=E5=B8=88=E6=88=96=E6=95=99=E8=BE=85=E6=B6=88=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7425692c0..2ffc7338e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -918,6 +918,9 @@ class UsersController < ApplicationController end def show + #更新用户申请成为课程老师或教辅消息的状态 + join_course_messages = CourseMessage.where("course_message_type =? and course_message_id =? and viewed =?", 'JoinCourseRequest', @user.id, false) + join_course_messages.update_all(:viewed => true) @page = params[:page] ? params[:page].to_i + 1 : 0 user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")" user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"