chengwl 4 years ago
parent
commit
f34ec21f28
1 changed files with 2 additions and 2 deletions
  1. 2 2
      controllers/IndexController.php

+ 2 - 2
controllers/IndexController.php

@@ -116,7 +116,7 @@ class IndexController extends Controller
  * @param service An authorized Analytics Reporting API V4 service object.
  * @return The Analytics Reporting API V4 response.
  */
-function getReport($analytics,$metrics) {
+function getReport($analytics,$arr) {
   $VIEW_ID = "155703065";
   // Create the DateRange object.
   $dateRange = new \Google_Service_AnalyticsReporting_DateRange();
@@ -125,7 +125,7 @@ function getReport($analytics,$metrics) {
   $metrics=[];
   $dimensions=[];
 
-  foreach($metrics as $k=>$v){
+  foreach($arr as $k=>$v){
     $Metric = new \Google_Service_AnalyticsReporting_Metric();
     $Metric->setExpression($v);
     $Metric->setAlias($k);