Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php |
— | — | @@ -33,12 +33,17 @@ |
34 | 34 | $query = $this->getQueryInfo(); |
35 | 35 | $query['fields'] = $this->getQueryFields(); |
36 | 36 | |
| 37 | + // Params needed for extra filters etc |
| 38 | + // months, normalized, data, reportlanguage |
| 39 | + // selectregions, selectcountries, selectwebproperties, selectprojects, selectwikis, selecteditors, selectedits, selectplatform |
| 40 | + |
37 | 41 | $db = $this->getDB(); |
38 | 42 | |
39 | 43 | $this->profileDBIn(); |
40 | 44 | $res = $db->select( $query['table'], $query['fields'], $query['conds'], __METHOD__, $query['options'], $query['join_conds'] ); |
41 | 45 | $this->profileDBOut(); |
42 | 46 | |
| 47 | + $result = $this->getResult(); |
43 | 48 | foreach( $res as $row ) { |
44 | 49 | |
45 | 50 | } |
Index: trunk/extensions/MetricsReporting/metrics/ComScoreUniqueVisitorMetric.php |
— | — | @@ -10,11 +10,19 @@ |
11 | 11 | } |
12 | 12 | |
13 | 13 | protected function getQueryInfo() { |
14 | | - return array(); |
| 14 | + return array( |
| 15 | + 'table' => array( 'comscore', 'comscore_regions' ), |
| 16 | + 'conds' => array(), |
| 17 | + 'options' => array( 'ORDER BY' => 'date, project_code, region_code' ), |
| 18 | + 'join_conds' => array( 'comscore_regions' => array( 'LEFT JOIN', 'comscore.region_code = comscore_regions.region_code' ) ), |
| 19 | + ); |
15 | 20 | } |
16 | 21 | |
17 | 22 | protected function getQueryFields() { |
18 | | - return array(); |
| 23 | + return array( |
| 24 | + 'date', 'country_code', /* 'country_name', */ 'comscore.region_code', |
| 25 | + 'region_name', 'web_property', 'project_code', 'reach', 'visitors' |
| 26 | + ); |
19 | 27 | } |
20 | 28 | |
21 | 29 | public function getDescription() { |
Index: trunk/extensions/MetricsReporting/README |
— | — | @@ -20,6 +20,19 @@ |
21 | 21 | ); |
22 | 22 | } |
23 | 23 | |
| 24 | + protected function getQueryInfo() { |
| 25 | + return array( |
| 26 | + 'table' => array(), |
| 27 | + 'conds' => array(), |
| 28 | + 'options' => array(), |
| 29 | + 'join_conds' => array() ), |
| 30 | + ); |
| 31 | + } |
| 32 | + |
| 33 | + protected function getQueryFields() { |
| 34 | + return array(); |
| 35 | + } |
| 36 | + |
24 | 37 | public function getDescription() { |
25 | 38 | return 'Wikipedians like balloons, right?'; |
26 | 39 | } |