diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 9f62a03bb..6c2eb5299 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -928,12 +928,14 @@ class CoursesController < ApplicationController course_message.save! - role = course_message.content == 2 ? '7' : '9' # 7:助教 9:教师 + role = course_message.content == 2 ? '9' : '7' # 7:助教 9:教师 ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role) - message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" + message = "#{course_message.content == 2 ? '教师' : '助教'}申请已提交,请等待审核" else - message = "#{existing_course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" + message = "#{existing_course_message.content == 2 ? '教师' : '助教'}申请已提交,请等待审核" end + else + message = "您已是课堂成员" end teacher_role = 1 end diff --git a/app/models/user.rb b/app/models/user.rb index b453f9998..e9d6ce54b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -234,7 +234,7 @@ class User < ApplicationRecord # 课堂的老师(创建者、老师、助教),不用考虑当前身份 def teacher_of_course_non_active?(course) - course.course_members.exists?(user_id: id, role: [1,2,3]) || admin? || business? + course.course_members.exists?(user_id: id, role: [1,2,3]) end # 是否是教师,课堂管理员或者超级管理员