소스 검색

secret api call

master
memespring 16 년 전
부모
커밋
cdecddd8bd
2개의 변경된 파일18개의 추가작업 그리고 1개의 파일을 삭제
  1. +6
    -1
      docs/api.php
  2. +12
    -0
      docs/include/application.php

+ 6
- 1
docs/api.php 파일 보기

@@ -118,7 +118,12 @@ class api {
$this->applications = Applications::query_area($_GET['bottom_left_easting'], $_GET['bottom_left_northing'], $_GET['top_right_easting'], $_GET['top_right_easting']);
}
break;

case "latest":
$this->applications = Applications::query_latest(500);
break;

query_latest
default:
$this->warnings = "No call type specified";
}


+ 12
- 0
docs/include/application.php 파일 보기

@@ -145,6 +145,18 @@ class Applications{
return applications::load_applications($application_results);
}
//latest
function query_latest($count = 100) {
$db = DB::connect(DB_CONNECTION_STRING);
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, date_scraped, full_name
from application
inner join authority on application.authority_id = authority.authority_id
order by date_scraped desc limit " . $count;

$application_results = $db->getAll($sql);
return applications::load_applications($application_results);
}
function load_applications($application_results){
$applications = array();
if (sizeof($application_results) > 0) {


불러오는 중...
취소
저장