diff --git a/lib/tasks/schools.rake b/lib/tasks/schools.rake index f5a66a786..3b62c5e20 100644 --- a/lib/tasks/schools.rake +++ b/lib/tasks/schools.rake @@ -17,5 +17,12 @@ namespace :schools do # 改变课堂的学校id Course.where(school_id: merge_schools).update_all(school_id: f_school) + + # 实训报告表迁移数据 + s_report = SchoolReport.find_by(school_id: f_school) + SchoolReport.where(school_id: merge_schools).each do |sr| + s_report.update_column(:shixun_evaluate_count, shixun_evaluate_count+sr.shixun_evaluate_count) + sr.update(shixun_evaluate_count: 0) + end end end \ No newline at end of file