當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TiendaHelperBase::local_to_GMT_data方法代碼示例

本文整理匯總了PHP中TiendaHelperBase::local_to_GMT_data方法的典型用法代碼示例。如果您正苦於以下問題:PHP TiendaHelperBase::local_to_GMT_data方法的具體用法?PHP TiendaHelperBase::local_to_GMT_data怎麽用?PHP TiendaHelperBase::local_to_GMT_data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TiendaHelperBase的用法示例。


在下文中一共展示了TiendaHelperBase::local_to_GMT_data方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _getData

 /**
  * Override parent::_getData() to insert groupBy and orderBy clauses into query
  *  
  * @return unknown_type
  */
 function _getData()
 {
     $state = $this->_getState();
     $order_states = array('3', '5', '17');
     $filter_date_from = $state['filter_date_from'];
     $filter_date_to = $state['filter_date_to'];
     if (empty($filter_date_to) and empty($filter_date_from)) {
         $date = JFactory::getDate();
         $today = $date->toFormat("%Y-%m-%d 00:00:00");
         $filter_date_to = $today;
         $database = JFactory::getDBO();
         $query = " SELECT DATE_SUB('" . $today . "', INTERVAL 1 MONTH) ";
         $database->setQuery($query);
         $filter_date_from = $database->loadResult();
     } else {
         if (empty($filter_date_to) and !empty($filter_date_from)) {
             $filter_date_to = $filter_date_from;
         } else {
             if (!empty($filter_date_to) and empty($filter_date_from)) {
                 $filter_date_from = $filter_date_to;
             }
         }
     }
     $date_tmp = date_create($filter_date_to);
     date_modify($date_tmp, '24 hour');
     $database = JFactory::getDBO();
     $curdate = TiendaHelperBase::local_to_GMT_data($filter_date_from);
     $enddate = TiendaHelperBase::local_to_GMT_data(date_format($date_tmp, 'Y-m-d H:i:s'));
     while ($curdate < $enddate) {
         // set working variables
         $variables = TiendaHelperBase::setDateVariables($curdate, $enddate, 'daily');
         $thisdate = $variables->thisdate;
         $nextdate = $variables->nextdate;
         $query = new TiendaQuery();
         $query->select('COUNT(tbl.order_id) AS num, SUM(order_total) AS amount');
         $query->from('#__tienda_orders AS tbl');
         $query->where("tbl.order_state_id IN (" . $this->getStatesCSV() . ")");
         $query->where("tbl.modified_date >= '" . $curdate . "'");
         $query->where("tbl.modified_date <= '" . $nextdate . "'");
         $database->setQuery((string) $query);
         $return_daily_report = $database->loadObject();
         $date_tmp = date_create(TiendaHelperBase::GMT_to_local_data($curdate));
         $data_print = date_format($date_tmp, 'd-m-Y');
         $return_range_report->{$data_print} = $return_daily_report;
         // increase curdate to the next value
         $curdate = $nextdate;
     }
     return $return_range_report;
 }
開發者ID:annggeel,項目名稱:tienda,代碼行數:54,代碼來源:report_dailysales.php

示例2: getCorrectBeginDayTime

 /**
  * Method which gets a correct time of beginning of a day with respect to the current time zone
  * 
  * @param $date	Joomla JDate object
  * 
  * @return Correct Datetime with respect to the current time zone
  */
 function getCorrectBeginDayTime($date)
 {
     $date_gmt = $date;
     if (is_object($date_gmt)) {
         $date_gmt = $date_gmt->toFormat("%Y-%m-%d %H:%M:%S");
     }
     $date_local = TiendaHelperBase::GMT_to_local_data((string) $date_gmt);
     $startdate_gmt = date_format(date_create($date_local), 'Y-m-d 00:00:00');
     return TiendaHelperBase::local_to_GMT_data($startdate_gmt);
 }
開發者ID:annggeel,項目名稱:tienda,代碼行數:17,代碼來源:_base.php


注:本文中的TiendaHelperBase::local_to_GMT_data方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。