From d2a282e37befae934cd25424c9e1b0dad371d1fb Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 12 Mar 2020 12:10:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=95=B0=E7=9B=AE=E8=BF=81?= =?UTF-8?q?=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/schools.rake | 7 +++++++ 1 file changed, 7 insertions(+) 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