This commit is contained in:
guange 2016-06-24 15:45:50 +08:00
parent 9a9f6400da
commit 657e506071
1 changed files with 1 additions and 1 deletions

View File

@ -355,7 +355,7 @@ class CoursesService
#如果加入角色为教师或者教辅,并且当前是学生,或者是要成为教辅,当前不是教辅,或者要成为教师,当前不是教师。那么要发送请求
elsif (params[:role] != "10" && roleName == "Student") || (params[:role] == "7" && roleName != "TeachingAsistant" ) || (params[:role] == "9" && roleName != "Teacher" )
#如果已经发送过消息了,那么就要给个提示
if CourseMessage.where("course_message_type = 'JoinCourseRequest' and user_id = #{course.tea_id} and content = #{params[:role]} and course_message_id = #{User.current.id} and course_id = #{course.id} and status = 0 ").count != 0
if CourseMessage.where("course_message_type = 'JoinCourseRequest' and user_id = #{course.tea_id} and course_message_id = #{User.current.id} and course_id = #{course.id} and status = 0 ").count != 0
@state = 7
else
Mailer.run.join_course_request(course, User.current, params[:role])