Index: trunk/extensions/GeoData/ApiQueryGeoSearch.php |
— | — | @@ -60,9 +60,15 @@ |
61 | 61 | |
62 | 62 | $dbr = wfGetDB( DB_SLAVE ); |
63 | 63 | $this->addTables( array( 'geo_tags', 'page' ) ); |
64 | | - $this->addFields( array( 'page_namespace', 'page_title', 'gt_lat', 'gt_lon', |
| 64 | + $this->addFields( array( 'gt_lat', 'gt_lon', |
65 | 65 | "{$dbr->tablePrefix()}gd_distance( {$lat}, {$lon}, gt_lat, gt_lon ) AS dist" ) |
66 | 66 | ); |
| 67 | + // retrieve some fields only if page set needs them |
| 68 | + if ( is_null( $resultPageSet ) ) { |
| 69 | + $this->addFields( 'page_id', 'page_namespace', 'page_title' ); |
| 70 | + } else { |
| 71 | + $this->addFields( array( "{$dbr->tableName( 'page' )}.*" ) ); |
| 72 | + } |
67 | 73 | $this->addWhereRange( 'gt_lat', 'newer', $rect["minLat"], $rect["maxLat"], false ); |
68 | 74 | $this->addWhereRange( 'gt_lon', 'newer', $rect["minLon"], $rect["maxLon"], false ); |
69 | 75 | //$this->addWhere( 'dist < ' . intval( $radius ) ); hasta be in HAVING, not WHERE |
— | — | @@ -165,6 +171,6 @@ |
166 | 172 | } |
167 | 173 | |
168 | 174 | public function getVersion() { |
169 | | - return __CLASS__ . ': $Id: ApiQueryGeoSearch.php 106945 2011-12-21 15:00:59Z maxsem $'; |
| 175 | + return __CLASS__ . ': $Id$'; |
170 | 176 | } |
171 | 177 | } |
Property changes on: trunk/extensions/GeoData/ApiQueryGeoSearch.php |
___________________________________________________________________ |
Added: svn:keywords |
172 | 178 | + Id |