function getCasaWithAttachmentTest() { $id = 1; $service = new CasaService(); $casa = $service->getCasaWithAttachment($id); echo $casa->attachment->filepath; echo '<br/>'; var_dump($casa); }
public function create($recomms) { $recom_arr = explode(';', $recomms); $data = array(); foreach ($recom_arr as $value) { $casaService = new CasaService(); if (!empty($value)) { $casa = $casaService->getWholeCasa($value); $casa_arr = array('id' => $casa->id, 'name' => $casa->name, 'pic' => $casa->main_photo_name, 'theme' => $casa->tags[0]->name); array_push($data, $casa_arr); } } var_dump($data); }
?> </p> </div> </div> </div> <div class="section"> <div class="col-md-3 hidden-sm hidden-xs"> <img src="http://casarover.oss-cn-hangzhou.aliyuncs.com/image/tj_mx.png" width="100%" alt=""> </div> <div class="m-radius-title visible-sm visible-xs"> <h4>推荐民宿</h4> </div> <div class="col-md-9 recom-main"> <?php $casaService = new CasaService(); $areaDao = new AreaDao(); $casas = array(); $casaSimpleRows = $areaDao->getRecommendCasas($area_id); while ($row = mysql_fetch_array($casaSimpleRows)) { array_push($casas, $casaService->getCasaWithAttachment($row['id'])); } if (count($casas) == 0) { ?> <?php foreach ($themes as $value) { ?> <div class="col-md-6" onclick="goto_casa(4)"> <div class="recom-content" > <div class="top-pic"> <img src="<?php
<?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);
" type="text/javascript"></script> <script src="js/casa.js?ver=<?php echo $ver; ?> " type="text/javascript"></script> <!--[if lt IE 9]> <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <?php include '301.php'; require_once '../application/services/CasaService.php'; $casa_id = $_GET["casa_id"]; $casaService = new CasaService(); if (!$casa_id) { $info = "casa_id未定义"; header("Location:error.php?info=" . $info); exit; } $casa = $casaService->getWholeCasa($casa_id); if (!$casa) { $info = "casa_id过大或非法"; header("Location:error.php?info=" . $info); exit; } $picdir = ''; include 'header.php'; ?> <div class="container">
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/AttachmentDao.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/AreaDao.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/ContentDao.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/ContentAttachmentDao.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/services/CasaService.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/services/ContentService.php'; $casa_JSON_str = remove_slash($_REQUEST['casa_JSON_str']); $casa = json_decode($casa_JSON_str); $casaDao = new CasaDao(); $areaDao = new AreaDao(); $attachmentDao = new AttachmentDao(); $tagDao = new TagDao(); $casaTagDao = new CasaTagDao(); $contentDao = new ContentDao(); $contentAttachmentDao = new ContentAttachmentDao(); $casaService = new CasaService(); $contentService = new ContentService(); mysql_query('START TRANSACTION') or die(mysql_error()); $mode = 'edit'; if (empty($casa->id)) { $mode = 'add'; } /** 1.添加基础民宿 */ if (!empty($casa->name) && !empty($casa->code) && !empty($casa->area)) { $casa_id = $casaDao->addOrUpdateSimple($casa->name, $casa->code, $casa->link, $casa->area, $casa->id); if (!$casa_id) { mysql_query('ROLLBACK'); header('Location:../../website/backstage/error.php?info=添加或更新民宿对象信息失败!' . mysql_error() . '&type=casa'); exit; } } else {