2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-04-26 06:17:10 -04:00
|
|
|
Report.add_report('topics_with_no_response') do |report|
|
2020-04-22 04:52:50 -04:00
|
|
|
category_id, include_subcategories = report.add_category_filter
|
2019-04-26 06:17:10 -04:00
|
|
|
|
2019-03-29 05:54:56 -04:00
|
|
|
report.data = []
|
2020-04-22 04:52:50 -04:00
|
|
|
Topic.with_no_response_per_day(report.start_date, report.end_date, category_id, include_subcategories).each do |r|
|
2019-04-26 06:17:10 -04:00
|
|
|
report.data << { x: r['date'], y: r['count'].to_i }
|
2019-03-29 05:54:56 -04:00
|
|
|
end
|
2019-04-26 06:17:10 -04:00
|
|
|
|
2020-04-22 04:52:50 -04:00
|
|
|
report.total = Topic.with_no_response_total(category_id: category_id, include_subcategories: include_subcategories)
|
2019-04-26 06:17:10 -04:00
|
|
|
|
2020-04-22 04:52:50 -04:00
|
|
|
report.prev30Days = Topic.with_no_response_total(start_date: report.start_date - 30.days, end_date: report.start_date, category_id: category_id, include_subcategories: include_subcategories)
|
2019-03-29 05:54:56 -04:00
|
|
|
end
|