From: Vincent Vanwaelscappel Date: Thu, 11 Jan 2024 15:07:36 +0000 (+0100) Subject: wait #6623 @0.75 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0d7b66bac9bce606695daba47e16d93509f76902;p=fluidbook-toolbox.git wait #6623 @0.75 --- diff --git a/app/Fluidbook/Stats.php b/app/Fluidbook/Stats.php index 5517c2c06..344d43e63 100644 --- a/app/Fluidbook/Stats.php +++ b/app/Fluidbook/Stats.php @@ -236,7 +236,10 @@ class Stats extends Reporting // 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); }); @@ -495,7 +498,7 @@ class Stats extends Reporting $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 []; } diff --git a/app/Http/Controllers/Admin/Operations/FluidbookPublication/StatsOperation.php b/app/Http/Controllers/Admin/Operations/FluidbookPublication/StatsOperation.php index 156c82336..dd97044c6 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookPublication/StatsOperation.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookPublication/StatsOperation.php @@ -108,9 +108,8 @@ trait StatsOperation $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(); } /** @@ -122,7 +121,7 @@ trait StatsOperation * @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;