@@ -24,4 +24,4 @@ |
||
| 24 | 24 | ], |
| 25 | 25 | ], |
| 26 | 26 | ]; |
| 27 | - |
|
| 28 | 27 | \ No newline at end of file |
| 28 | + |
|
| 29 | 29 | \ No newline at end of file |
@@ -133,25 +133,25 @@ |
||
| 133 | 133 | /** |
| 134 | 134 | * |
| 135 | 135 | */ |
| 136 | - public function getGasesDistributionAction() |
|
| 137 | - { |
|
| 138 | - $year = (int)$this->params()->fromRoute('year'); |
|
| 136 | + public function getGasesDistributionAction() |
|
| 137 | + { |
|
| 138 | + $year = (int)$this->params()->fromRoute('year'); |
|
| 139 | 139 | |
| 140 | - $response = []; |
|
| 140 | + $response = []; |
|
| 141 | 141 | |
| 142 | - $results = $this->entityManager->getRepository(Emission::class)->findGasesByYear($year); |
|
| 142 | + $results = $this->entityManager->getRepository(Emission::class)->findGasesByYear($year); |
|
| 143 | 143 | |
| 144 | - $response['gases'][] = 'x'; |
|
| 145 | - $response['valores'][] = 'Gases'; |
|
| 144 | + $response['gases'][] = 'x'; |
|
| 145 | + $response['valores'][] = 'Gases'; |
|
| 146 | 146 | |
| 147 | - foreach ($results as $result) { |
|
| 148 | - $response['gases'][] = (strpos($result['name'], ',')) ? '"'.$result['name'].'"' : $result['name']; |
|
| 149 | - $response['valores'][] = round($result['total']); |
|
| 150 | - $response['colores'][] = $result['color']; |
|
| 151 | - } |
|
| 147 | + foreach ($results as $result) { |
|
| 148 | + $response['gases'][] = (strpos($result['name'], ',')) ? '"'.$result['name'].'"' : $result['name']; |
|
| 149 | + $response['valores'][] = round($result['total']); |
|
| 150 | + $response['colores'][] = $result['color']; |
|
| 151 | + } |
|
| 152 | 152 | |
| 153 | - return new JsonModel($response); |
|
| 154 | - } |
|
| 153 | + return new JsonModel($response); |
|
| 154 | + } |
|
| 155 | 155 | |
| 156 | 156 | public function getSectoralGasesDistributionAction() |
| 157 | 157 | { |
@@ -6,9 +6,9 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | class SubactivityRepository extends EntityRepository |
| 8 | 8 | { |
| 9 | - public function findActivitySectorBySector($sector) |
|
| 10 | - { |
|
| 11 | - $dql = 'SELECT sub.name |
|
| 9 | + public function findActivitySectorBySector($sector) |
|
| 10 | + { |
|
| 11 | + $dql = 'SELECT sub.name |
|
| 12 | 12 | FROM Api\Entity\Subactivity sub |
| 13 | 13 | INNER JOIN sub.activity a |
| 14 | 14 | INNER JOIN Api\Entity\Sector s WITH s.id = a.sector |
@@ -18,5 +18,5 @@ discard block |
||
| 18 | 18 | return $this->getEntityManager()->createQuery($dql) |
| 19 | 19 | ->setParameter('sector', $sector) |
| 20 | 20 | ->getResult(); |
| 21 | - } |
|
| 21 | + } |
|
| 22 | 22 | } |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | 'factories' => [ |
| 115 | 115 | Controller\DistributionReportController::class => Factory\DistributionReportControllerFactory::class, |
| 116 | 116 | Controller\EvolutionReportController::class => Factory\EvolutionReportControllerFactory::class, |
| 117 | - Controller\IndicatorsReportController::class => Factory\IndicatorsReportControllerFactory::class, |
|
| 117 | + Controller\IndicatorsReportController::class => Factory\IndicatorsReportControllerFactory::class, |
|
| 118 | 118 | ], |
| 119 | 119 | ], |
| 120 | 120 | 'view_manager' => [ |