diff --git a/app/controllers/admins/laboratory_subjects_controller.rb b/app/controllers/admins/laboratory_subjects_controller.rb index 866a20a76..d552b006e 100644 --- a/app/controllers/admins/laboratory_subjects_controller.rb +++ b/app/controllers/admins/laboratory_subjects_controller.rb @@ -17,7 +17,9 @@ class Admins::LaboratorySubjectsController < Admins::BaseController def destroy return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership? - current_laboratory_subject.destroy! + current_subject = current_laboratory_subject.subject + current_subject.shixuns.destroy_all + current_subject.destroy! render_delete_success end