Commit a941da228df66adda43f1c4e7b2a5d5a37d17569
1 parent
c1560a1d
ga output
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
app/library/App/Controllers/GaController.php
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 | namespace App\Controllers; |
10 | 10 | |
11 | 11 | |
12 | +use App\Model\Project; | |
12 | 13 | use Google_Client; |
13 | 14 | use Google_Service_AnalyticsReporting; |
14 | 15 | use Google_Service_AnalyticsReporting_DateRange; |
... | ... | @@ -80,10 +81,11 @@ class GaController extends CrudResourceController { |
80 | 81 | |
81 | 82 | //have to rewrite code below (2 rows) |
82 | 83 | $response = $response->toSimpleObject(); |
83 | - die(var_dump($response)); | |
84 | 84 | $response = $response->reports[0]['data']['rows']; |
85 | 85 | |
86 | 86 | $result = []; |
87 | + $project = Project::findFirst(['ga_view_id' => $view_id]); | |
88 | + $result['name'] = $project->name; | |
87 | 89 | |
88 | 90 | foreach ($response as $item) { |
89 | 91 | ... | ... |