Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

video_log
cxt 5 years ago
commit af995b9dfa

@ -1,7 +1,7 @@
class Admins::UserSchoolsStatisticsController < Admins::BaseController
def export
params[:per_page] = 10000
params[:per_page] = 50
_count, @schools = Admins::UserSchoolsStatisticQuery.call(params)
filename = ['用户运营统计', Time.zone.now.strftime('%Y%m%d%H%M%S')].join('-') << '.xlsx'

@ -0,0 +1,17 @@
desc "同步学院或者单位评测数"
namespace :sync_evaluate do
task outpus_count: :environment do
School.find_each do |school|
puts school.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 = #{school}.id").firt.try(:e_count)
report = SchoolReport.find_or_initialize_by(school_id: school.id)
report.school_name = school.name
report.shixun_evaluate_count = evaluate_count
report.save
end
end
end
Loading…
Cancel
Save