예제 #1
0
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/services/TagService.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/services/CasaService.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/controllers/AreaController.php';
$area_id = $_GET['area_id'];
$areaService = new AreaService();
$picdir = 'http://casarover.oss-cn-hangzhou.aliyuncs.com/casa/';
$city_ids = $areaService->getCityIdsIncludeDirect();
if (!empty($area_id) && in_array($area_id, $city_ids)) {
    $areaDao = new AreaDao();
    $area = new Area($areaDao->getById($area_id));
} else {
    header('Location:error.php?info=无效城市!');
}
$tagService = new TagService();
$officialTags = $tagService->getOfficialTags();
$subAreas = $areaService->getSubAreas($area_id);
$casaService = new CasaService();
$casas = array();
// because there may be casa that has no tag,
// if one casa has no tag, it will never appear in the result of getForCitySearch(),
// root cause is in sql query statement, look into CasaDao.getByMultiConfition().
if (empty($_GET['themes']) && empty($_GET['sceneries'])) {
    $casas = $casaService->getCasasByCityId($area_id);
} else {
    $casas = $casaService->getForCitySearch($area_id, $_GET['themes'], null, $_GET['sceneries']);
}
$area = new AreaController();
$message = $area->simpleMess();
?>
<input id="city_id" type="hidden" value="<?php 
echo $_GET['area_id'];