当前位置: 首页>>代码示例>>PHP>>正文


PHP Helper::dateForSearch方法代码示例

本文整理汇总了PHP中Library\Utility\Helper::dateForSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::dateForSearch方法的具体用法?PHP Helper::dateForSearch怎么用?PHP Helper::dateForSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Library\Utility\Helper的用法示例。


在下文中一共展示了Helper::dateForSearch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getOptions

 /**
  * @param array $data
  * @return array
  */
 public function getOptions($data)
 {
     $params = $this->getOptionsForSearch();
     $filterData = $this->filterSearchData($data);
     if ($filterData) {
         $params['status'] = 'error';
         $params['msg'] = $filterData;
         return $params;
     }
     if (isset($data['city'])) {
         $citySlug = $data['city'];
         $cityDao = new City($this->getServiceLocator(), 'ArrayObject');
         $cityResp = $cityDao->getCityBySlug($citySlug);
         $params['city_url'] = $citySlug;
         if (!$cityResp) {
             $params['status'] = 'error';
             $params['msg'] = $this->getTextLineSite(1220);
             return $params;
         }
         $cityId = $cityResp['id'];
         $timezone = $cityResp['timezone'];
     } elseif (isset($data['apartel'])) {
         /**
          * @var \DDD\Dao\Apartel\General $apartelDao
          */
         $apartelSlug = $data['apartel'];
         $apartelDao = $this->getServiceLocator()->get('dao_apartel_general');
         $apartelData = $apartelDao->getApartelDataBySlug($apartelSlug);
         if (!$apartelData) {
             $params['status'] = 'error';
             $params['msg'] = $this->getTextLineSite(1220);
             return $params;
         }
         $params['apartel_url'] = $apartelSlug;
         $params['apartel_name'] = $apartelData['apartel_name'];
         $cityId = $apartelData['city_id'];
         $timezone = $apartelData['timezone'];
     } else {
         return ['status' => 'error'];
     }
     $params['current_date'] = Helper::getCurrenctDateByTimezone($timezone, 'd-m-Y');
     $correcrData = $this->correctData($data);
     $params['city_id'] = $cityId;
     $params['guest_user'] = $correcrData['guest'];
     $params['page'] = $correcrData['page'];
     $params['arrival'] = $correcrData['arrival'] ? Helper::dateForSearch($correcrData['arrival']) : '';
     $params['departure'] = $correcrData['departure'] ? Helper::dateForSearch($correcrData['departure']) : '';
     $params['status'] = 'success';
     return $params;
 }
开发者ID:arbi,项目名称:MyCode,代码行数:54,代码来源:Search.php

示例2: indexAction

 public function indexAction()
 {
     /**
      * @var Apartment $apartmentService
      */
     try {
         if (!($pageSlug = $this->params()->fromRoute('apartmentTitle')) || !ClassicValidator::checkApartmentTitle($pageSlug)) {
             $viewModel = new ViewModel();
             $this->getResponse()->setStatusCode(404);
             return $viewModel->setTemplate('error/404');
         }
         /* @var $apartmentService \DDD\Service\Website\Apartment */
         $apartmentService = $this->getApartmentService();
         $apartment = $apartmentService->getApartment($pageSlug);
         if (!$apartment) {
             $this->getResponse()->setStatusCode(404);
             $viewModel = new ViewModel();
             return $viewModel->setTemplate('error/404');
         }
         $request = $this->getRequest();
         $data = $request->getQuery();
         $data['slug'] = $pageSlug;
         $filtreData = $apartmentService->filterQueryData($data);
         $reviewCount = false;
         if ($filtreData) {
             $apartment['otherParams']['arrival'] = Helper::dateForSearch($data['arrival']);
             $apartment['otherParams']['departure'] = Helper::dateForSearch($data['departure']);
         }
         if (isset($apartment['general']['aprtment_id'])) {
             $reviewCount = $apartmentService->apartmentReviewCount($apartment['general']['aprtment_id']);
         }
         $show_reviews = false;
         $reviews = [];
         $apartment['otherParams']['guest'] = (int) $data['guest'];
         if (isset($data['show']) && $data['show'] == 'reviews' && isset($apartment['general']['aprtment_id']) && $apartment['general']['aprtment_id'] > 0) {
             $show_reviews = true;
             $reviewsResult = $apartmentService->apartmentReviewList(['apartment_id' => $apartment['general']['aprtment_id']], true);
             if ($reviewsResult && $reviewsResult['result']->count() > 0) {
                 $reviews = $reviewsResult['result'];
             }
         }
     } catch (\Exception $e) {
         $this->gr2logException($e, 'Website: Apartment Page Failed');
         return $this->redirect()->toRoute('home');
     }
     $this->layout()->setVariable('view_currency', 'yes');
     return new ViewModel(['general' => $apartment['general'], 'amenities' => $apartment['amenities'], 'facilities' => $apartment['facilities'], 'otherParams' => $apartment['otherParams'], 'secure_url_booking' => 'https://' . DomainConstants::WS_SECURE_DOMAIN_NAME . '/booking', 'show_reviews' => $show_reviews, 'reviews' => $reviews, 'reviewCount' => $reviewCount, 'sl' => $this->getServiceLocator(), 'apartelId' => (int) $data['apartel_id'] > 0 ? (int) $data['apartel_id'] : 0]);
 }
开发者ID:arbi,项目名称:MyCode,代码行数:48,代码来源:ApartmentController.php


注:本文中的Library\Utility\Helper::dateForSearch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。