You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
551 B
14 lines
551 B
5 years ago
|
# 删除课堂时将相应的课堂消息置为删除状态,并给老师发送删除消息
|
||
|
class DeleteCourseNotifyJob < ApplicationJob
|
||
|
queue_as :default
|
||
|
|
||
|
def perform(course_id, user_id)
|
||
|
course = Course.find_by(id: course_id)
|
||
|
return if course.blank?
|
||
|
|
||
|
Tiding.where(belong_container: course).update_all(is_delete: 1)
|
||
|
Tiding.create!(user_id: user_id, trigger_user_id: user_id, container_id: course.id,
|
||
|
container_type: 'DeleteCourse', tiding_type: 'System', belong_container: course, extra: course.name)
|
||
|
end
|
||
|
end
|