|
|
|
@ -7,8 +7,8 @@ namespace :sync_evaluate do
|
|
|
|
|
else
|
|
|
|
|
schools = School.all
|
|
|
|
|
end
|
|
|
|
|
schools.find_each do |school|
|
|
|
|
|
Parallel.each_with_index(school, in_processes: 5) do |s|
|
|
|
|
|
schools.find_each do |s|
|
|
|
|
|
#Parallel.each_with_index(school, in_processes: 5) do |s|
|
|
|
|
|
puts "school_id:#{s.id}"
|
|
|
|
|
evaluate_count = Game.find_by_sql("select sum(g.evaluate_count) as e_count from games g, user_extensions ue where
|
|
|
|
|
g.user_id = ue.user_id and ue.school_id = '#{s.id}'").first.try(:e_count)
|
|
|
|
@ -19,7 +19,7 @@ namespace :sync_evaluate do
|
|
|
|
|
report.shixun_evaluate_count = evaluate_count
|
|
|
|
|
|
|
|
|
|
report.save
|
|
|
|
|
end
|
|
|
|
|
#end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|