diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 34e039ae0..4dc2c52f5 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -163,9 +163,9 @@ class MembersController < ApplicationController #给新成员和老师发送加入课程的消息,发送者id放在CourseMessage的course_message_id字段中 #course_message_type设置为JoinCourse #status = 0 表示给学生发,status = 1表示给老师发 - course_join = CourseMessage.new(:user_id =>user_id, :course_message_id=>User.current.id,:course_id => @course.id,:course_message_type=>"JoinCourse", :viewed => false, :status => 0) + course_join = CourseMessage.new(:user_id =>user_id, :course_message_id=>User.current.id,:course_id => @course.id,:course_message_type=>"JoinCourse", :content => role, :viewed => false, :status => 0) course_join.save - CourseMessage.create(:user_id => User.current.id, :course_message_id => user_id, :course_id => @course.id, :course_message_type => "JoinCourse", :viewed => false, status => 1) + CourseMessage.create(:user_id => User.current.id, :course_message_id => user_id, :course_id => @course.id, :course_message_type => "JoinCourse",:content => role, :viewed => false, :status => 1) members << member #user_grades << UserGrade.new(:user_id => user_id, :course_id => @course.id) diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index a6086b888..678fac93b 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -511,7 +511,7 @@ <% end %> - <% if ma.course_message_type == "JoinCourse" %> + <% if ma.course_message_type == "JoinCourse" and ma.status == 0 %> + <% end %> + + + <% if ma.course_message_type == "JoinCourse" and ma.status == 1 %> +