加入课堂调整

dev_cs_new
cxt 6 years ago
parent b77c15cab7
commit 7d34d8ea3c

@ -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

@ -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
# 是否是教师,课堂管理员或者超级管理员

Loading…
Cancel
Save