Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php |
— | — | @@ -136,8 +136,6 @@ |
137 | 137 | $data = array(); |
138 | 138 | |
139 | 139 | $fields = array_map( array( $this, 'getColumnName' ), $query['fields'] ); |
140 | | - //$metricFields = $this->getMetricFields(); |
141 | | - //$metricTotals = array(); |
142 | 140 | |
143 | 141 | foreach( $res as $row ) { |
144 | 142 | // Dump all data to output |
— | — | @@ -145,52 +143,11 @@ |
146 | 144 | foreach( $fields as $field ) { |
147 | 145 | $item[$field] = $row->$field; |
148 | 146 | } |
149 | | - $data[] = $item; |
150 | | - |
151 | | - // Do some maths |
152 | | - //foreach( $metricFields as $field ) { |
153 | | - // if ( !isset( $metricTotals[$field] ) ) { |
154 | | - // $metricTotals[$field] = 0; |
155 | | - // } |
156 | | - // $metricTotals[$field] += $row->$field; |
157 | | - //} |
158 | | - |
159 | | - // Make grouped output data |
160 | | - foreach( $this->getAllowedFilters() as $filter ) { |
161 | | - if ( !isset( $params[$filter] ) ) { |
162 | | - continue; |
163 | | - } |
164 | | - if ( $params[$filter][0] === '*' ) { |
165 | | - // For */"all", don't do any filtering |
166 | | - continue; |
167 | | - } |
168 | | - |
169 | | - $parsedFilter = $this->getAllUniqueParams( $params[$filter] ); |
170 | | - switch ( $filter ) { |
171 | | - case 'selectregions': |
172 | | - break; |
173 | | - case 'selectcountries': |
174 | | - break; |
175 | | - case 'selectwebproperties': |
176 | | - break; |
177 | | - case 'selectprojects': |
178 | | - break; |
179 | | - case 'selectwikis': |
180 | | - break; |
181 | | - case 'selecteditors': |
182 | | - break; |
183 | | - case 'selectedits': |
184 | | - break; |
185 | | - case 'selectplatform': |
186 | | - break; |
187 | | - } |
188 | | - } |
| 147 | + $data[ $row->{$this->getColumnName( 'comscore.region_code' )} ][] = $item; |
189 | 148 | } |
190 | 149 | |
191 | 150 | $result->setIndexedTagName( $data, 'data' ); |
192 | | - //$result->setIndexedTagName( $metricTotals, 'totals' ); |
193 | 151 | $result->addValue( 'metric', $this->getModuleName(), $data ); |
194 | | - //$result->addValue( 'totals', $this->getModuleName(), $metricTotals ); |
195 | 152 | } |
196 | 153 | |
197 | 154 | // TODO: Deal with foo AS bar, and return bar for nicer aliasing of stuff |
Index: trunk/extensions/MetricsReporting/metrics/ComScoreReachPercentageMetric.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | return array( |
15 | 15 | 'table' => array( 'comscore', 'comscore_regions'), |
16 | 16 | 'conds' => array(), |
17 | | - 'options' => array( 'GROUP BY' => 'date', 'ORDER BY' => 'comscore.region_code, date' ), |
| 17 | + 'options' => array( 'GROUP BY' => 'comscore.region_code, date', 'ORDER BY' => 'comscore.region_code, date' ), |
18 | 18 | 'join_conds' => array( 'comscore_regions' => array( 'LEFT JOIN', "comscore.region_code = comscore_regions.region_code" ) |
19 | 19 | ), |
20 | 20 | ); |