Commit 54b1c15e20b21b5403509bb6396161223336ce30
Merge branch 'restart' of gitlab.artweb.com.ua:Alex/analytics into restart
Showing
2 changed files
with
6 additions
and
9 deletions
 
Show diff stats
app/library/App/Bootstrap/CollectionBootstrap.php
| ... | ... | @@ -4,11 +4,10 @@ namespace App\Bootstrap; | 
| 4 | 4 | |
| 5 | 5 | use App\BootstrapInterface; | 
| 6 | 6 | use App\Collections\ExportCollection; | 
| 7 | +use App\Resources\AllPositionResource; | |
| 7 | 8 | use App\Resources\GaResource; | 
| 8 | 9 | use App\Resources\ProjectResource; | 
| 9 | 10 | use App\Resources\UserResource; | 
| 10 | -use App\Resources\AlbumResource; | |
| 11 | -use App\Resources\PhotoResource; | |
| 12 | 11 | use Phalcon\Config; | 
| 13 | 12 | use Phalcon\DiInterface; | 
| 14 | 13 | use PhalconRest\Api; | 
| ... | ... | @@ -19,9 +18,8 @@ class CollectionBootstrap implements BootstrapInterface | 
| 19 | 18 | { | 
| 20 | 19 | $api | 
| 21 | 20 | ->resource(new GaResource('/ga')) | 
| 21 | + ->resource(new AllPositionResource('/ap')) | |
| 22 | 22 | ->resource(new UserResource('/users')) | 
| 23 | - //->resource(new AlbumResource('/albums')) | |
| 24 | - //->resource(new PhotoResource('/photos')) | |
| 25 | 23 | ->resource(new ProjectResource('/projects')) | 
| 26 | 24 | ->collection(new ExportCollection('/export')); | 
| 27 | 25 | } | ... | ... | 
app/library/App/Controllers/GaController.php
| ... | ... | @@ -10,7 +10,6 @@ namespace App\Controllers; | 
| 10 | 10 | |
| 11 | 11 | |
| 12 | 12 | use App\Model\Project; | 
| 13 | -use App\Model\User; | |
| 14 | 13 | use Google_Client; | 
| 15 | 14 | use Google_Service_AnalyticsReporting; | 
| 16 | 15 | use Google_Service_AnalyticsReporting_DateRange; | 
| ... | ... | @@ -54,7 +53,7 @@ class GaController extends CrudResourceController { | 
| 54 | 53 | $project = Project::findFirst(['ga_view_id' => $view_id]); | 
| 55 | 54 | $result = $this->sendGaRequest($project->name , $view_id, $get_metrics, $get_dimensions, $get_start_date, $get_end_date, $chart); | 
| 56 | 55 | } | 
| 57 | - return $result; | |
| 56 | + return '123'; | |
| 58 | 57 | |
| 59 | 58 | } | 
| 60 | 59 | |
| ... | ... | @@ -116,7 +115,7 @@ class GaController extends CrudResourceController { | 
| 116 | 115 | $result = self::responseDataTransform($response, $project_name); | 
| 117 | 116 | } | 
| 118 | 117 | |
| 119 | - return ($result); | |
| 118 | + return $result; | |
| 120 | 119 | |
| 121 | 120 | } | 
| 122 | 121 | |
| ... | ... | @@ -155,10 +154,10 @@ class GaController extends CrudResourceController { | 
| 155 | 154 | |
| 156 | 155 | if (count($metric_val) > 1) { | 
| 157 | 156 | for ($i = 0; $i < count($metric_val); $i++) { | 
| 158 | - $result['data'][] = $metric_val[$i]; | |
| 157 | + $result['data'][] = (int)$metric_val[$i]; | |
| 159 | 158 | } | 
| 160 | 159 | } else { | 
| 161 | - $result['data'][] = $metric_val[0]; | |
| 160 | + $result['data'][] = (int)$metric_val[0]; | |
| 162 | 161 | } | 
| 163 | 162 | } | 
| 164 | 163 | ... | ... |