// the expanded dataset that includes the subtables of pages. For some reason, Matomo
// doesn't aggregrate this value when there are sub pages, so we have to do it ourselves
$expanded_stats = $this->_supportUniqueVisitors() ? 1 : 0; // Only fetch extra data when it will be used
- $this->_pagesByPeriod = collect($this->getPageUrls(['expanded' => 1]))
+
+ $pagesURLS = $this->getPageUrls(['expanded' => 1]);
+
+ $this->_pagesByPeriod = collect($pagesURLS)
->map(function ($item, $date) {
return $this->_mapPagesByPeriod($item, $date);
});
$data['nb_prints'] = data_get($menu_events, 'print.nb_events', 0);
- if (empty($data['nb_openings']) || empty($data['nb_visits'])) {
+ if (empty($data['nb_openings']) && empty($data['nb_visits'])) {
return [];
}
$tables = $html->find('table');
$tmpfile = Files::tempnam() . '.xlsx';
- $this->Excel_($tables, $names, null, $tmpfile);
+ $this->_excel($tables, $names, null, $tmpfile);
return response()->download($tmpfile, $name . '.xlsx')->deleteFileAfterSend(true);
- die();
}
/**
* @return Spreadsheet
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
- public function Excel_($tables, $sheetnames, $head = null, $output = null, $width = null)
+ public function _excel($tables, $sheetnames, $head = null, $output = null, $width = null)
{
$columns = 0;