本文整理汇总了PHP中TiendaHelperBase::getCorrectBeginDayTime方法的典型用法代码示例。如果您正苦于以下问题:PHP TiendaHelperBase::getCorrectBeginDayTime方法的具体用法?PHP TiendaHelperBase::getCorrectBeginDayTime怎么用?PHP TiendaHelperBase::getCorrectBeginDayTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TiendaHelperBase
的用法示例。
在下文中一共展示了TiendaHelperBase::getCorrectBeginDayTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _lastYear
/**
*
* @return unknown_type
*/
function _lastYear()
{
$database = JFactory::getDBO();
$date = JFactory::getDate();
//get local data
$today = TiendaHelperBase::getCorrectBeginDayTime($date);
//first day of year
$first_day_year = $date->toFormat("%Y-01-01 00:00:00");
$enddate = TiendaHelperBase::getCorrectBeginDayTime($first_day_year);
$query = new TiendaQuery();
$query = " SELECT DATE_SUB('" . $enddate . "', INTERVAL 1 YEAR) ";
$database->setQuery($query);
$startdate = $database->loadResult();
$return = $this->_getDateDb($startdate, $enddate, true, true);
$days = $return->days_in_business > 0 ? $return->days_in_business : 1;
$return->average_daily = $return->num / $days;
return $return;
}