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.
educoder/app/views/admins/user_schools_statistics/export.xlsx.axlsx

18 lines
666 B

wb = xlsx_package.workbook
wb.add_worksheet(name: '用户运营统计') do |sheet|
sheet.add_row %w(单位名称 省份 注册老师数量 注册学生数量 活跃用户 学习关卡数 完成关卡数 评测次数)
@schools.each do |school|
data = [
school.name,
school.province,
school.display_extra_data(:reg_teacher_count),
school.display_extra_data(:reg_student_count),
school.display_extra_data(:user_active_count),
school.display_extra_data(:study_challenge_count),
school.display_extra_data(:finish_challenge_count),
school.display_extra_data(:evaluate_count),
]
sheet.add_row(data)
end
end