本文整理汇总了PHP中TiendaHelperBase::getToday方法的典型用法代码示例。如果您正苦于以下问题:PHP TiendaHelperBase::getToday方法的具体用法?PHP TiendaHelperBase::getToday怎么用?PHP TiendaHelperBase::getToday使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TiendaHelperBase
的用法示例。
在下文中一共展示了TiendaHelperBase::getToday方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDateMarginalOrder
/**
* Method to get date of the first or the last order
*
* @access private
* @return void
*/
public static function getDateMarginalOrder($states, $order = 'ASC')
{
$db = JFactory::getDBO();
$today = TiendaHelperBase::getToday();
$q = new TiendaQuery();
$q->select('tbl.created_date AS date');
$q->from('#__tienda_orders AS tbl');
$q->where(" tbl.order_state_id IN ( " . $states . " ) ");
$q->order(" tbl.created_date " . $order);
$db->setQuery((string) $q);
$return = $db->loadObject();
if ($return) {
$return = $return->date;
} else {
$return = $today;
}
return $return;
}
示例2: _lifetime
/**
* _lifetime function.
*
* @access private
* @return void
*/
function _lifetime()
{
$database = JFactory::getDBO();
$today = TiendaHelperBase::getToday();
Tienda::load('TiendaHelperOrder', 'helpers.order');
$firstsale_date = TiendaHelperOrder::getDateMarginalOrder($this->getStatesCSV(), 'ASC');
$lastsale_date = TiendaHelperOrder::getDateMarginalOrder($this->getStatesCSV(), 'DESC');
$return = $this->_getDateDb($firstsale_date, $lastsale_date);
$days = $return->days_in_business > 0 ? $return->days_in_business : 1;
$return->average_daily = $return->num / $days;
return $return;
}