Class: Crm::Reports::OrdersSoldController

Inherits:
ReportsController
  • Object
show all
Defined in:
app/controllers/crm/reports/orders_sold_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/crm/reports/orders_sold_controller.rb', line 4

def show
  # input from the show page
  @start_date = parse_date_or_default(params[:start_date], Date.current.beginning_of_year - 1.year)
  @end_date = parse_date_or_default(params[:end_date], Date.current)
  @channel = begin
    Analytic::ReportGroupingDimension.where(report_grouping: params[:report_grouping])
  rescue StandardError
    nil
  end
  @group_name = begin
    Analytic::ReportGroupingDimension.where(report_grouping: params[:report_grouping]).pick(:report_grouping).to_s
  rescue StandardError
    nil
  end
end