实训数目迁移

dev_jupyter
daiao 5 years ago
parent 0f22210bf5
commit d2a282e37b

@ -17,5 +17,12 @@ namespace :schools do
# 改变课堂的学校id # 改变课堂的学校id
Course.where(school_id: merge_schools).update_all(school_id: f_school) 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
end end
Loading…
Cancel
Save