{# 分析報表第二層分頁:保留頁面內容與圖表邏輯,只提供一致的報表切換入口。 #} {% set _analysis_active = active_page|default('') %} {% set _period = analysis_period|default({}) %} {% set _period_start = _period.start_date|default('') %} {% set _period_end = _period.end_date|default('') %} {% set _period_start_month = _period.start_month|default('') %} {% set _period_end_month = _period.end_month|default('') %} {% set _sales_href = '/sales_analysis' %} {% set _daily_href = '/daily_sales' %} {% set _growth_href = '/growth_analysis' %} {% set _monthly_href = '/monthly_summary_analysis' %} {% if _period_start and _period_end %} {% set _sales_href = '/sales_analysis?start_date=' ~ _period_start ~ '&end_date=' ~ _period_end %} {% endif %} {% if _period.is_single_day|default(false) and _period_end %} {% set _daily_href = '/daily_sales?date=' ~ _period_end %} {% elif _period_end_month %} {% set _daily_href = '/daily_sales?month=' ~ _period_end_month %} {% endif %} {% if _period_start_month and _period_end_month %} {% set _growth_href = '/growth_analysis?start_month=' ~ _period_start_month ~ '&end_month=' ~ _period_end_month %} {% set _monthly_href = '/monthly_summary_analysis?start_month=' ~ _period_start_month ~ '&end_month=' ~ _period_end_month %} {% endif %}