You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
366 B
16 lines
366 B
desc "统计每个学校使用数据"
|
|
|
|
namespace :static_all do
|
|
task :repo => :environment do
|
|
School.find_each(batch_size: 100) do |school|
|
|
User.joins(:user_extension).where(school_id: school.id)
|
|
|
|
|
|
report = StaAll.find_or_initialize_by(school_id: school.id)
|
|
|
|
report.shixun_evaluate_count = evaluate_count
|
|
|
|
report.save
|
|
end
|
|
end
|
|
end |