]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6623 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 11 Jan 2024 15:07:36 +0000 (16:07 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 11 Jan 2024 15:07:36 +0000 (16:07 +0100)
app/Fluidbook/Stats.php
app/Http/Controllers/Admin/Operations/FluidbookPublication/StatsOperation.php

index 5517c2c06c57ab1fe28dd6b9df01404493e0a866..344d43e63f51a30f50d51f1945a87bd0e2db8ee8 100644 (file)
@@ -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 [];
         }
 
index 156c82336adf97905018d77aa419d5095d1d37dc..dd97044c60ad507b00d834956eadef8fb8e7fd84 100644 (file)
@@ -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;