<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/services/CasaService.php'; $area_id = $_GET['area_id']; $casaService = new CasaService(); $casas = array(); $page = $_GET['page']; if (empty($_GET['themes']) && empty($_GET['sceneries'])) { $casas = $casaService->getCasasByCityId($area_id, $page); } else { $casas = $casaService->getForCitySearch($area_id, $_GET['themes'], null, $_GET['sceneries'], $page); } $data = array('status' => '0', 'msg' => 'ok', 'result' => $casas); echo json_encode($data);
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']; ?> "/> <input id="themes" type="hidden" value="<?php echo $_GET['themes']; ?> "/> <input id="sceneries" type="hidden" value="<?php