diff --git a/app/jobs/apply_teacher_role_join_course_notify_job.rb b/app/jobs/apply_teacher_role_join_course_notify_job.rb index c2495c036..3ae5e32db 100644 --- a/app/jobs/apply_teacher_role_join_course_notify_job.rb +++ b/app/jobs/apply_teacher_role_join_course_notify_job.rb @@ -11,7 +11,7 @@ class ApplyTeacherRoleJoinCourseNotifyJob < ApplicationJob belong_container_type tiding_type extra created_at updated_at] same_attrs = { - trigger_user_id: user.id, container_id: course.id, container_type: 'JoinCourse', + trigger_user_id: user.id, container_id: course.id, container_type: 'JoinCourse', status: 0, belong_container_id: course.id, belong_container_type: 'Course', tiding_type: 'Apply', extra: role } Tiding.bulk_insert(*attrs) do |worker| diff --git a/app/models/course.rb b/app/models/course.rb index 1f38827ae..25a017faa 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -327,7 +327,7 @@ class Course < ApplicationRecord #创建课程后,给该用户发送消息 def send_tiding - self.tidings << Tiding.new(user_id: tea_id, trigger_user_id: tea_id, belong_container_id: id, + self.tidings << Tiding.new(user_id: tea_id, trigger_user_id: 1, belong_container_id: id, belong_container_type: 'Course', tiding_type: 'System') end