本文整理汇总了PHP中CitruscartHelperBase::getToday方法的典型用法代码示例。如果您正苦于以下问题:PHP CitruscartHelperBase::getToday方法的具体用法?PHP CitruscartHelperBase::getToday怎么用?PHP CitruscartHelperBase::getToday使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CitruscartHelperBase
的用法示例。
在下文中一共展示了CitruscartHelperBase::getToday方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _lifetime
/**
* _lifetime function.
*
* @access private
* @return void
*/
function _lifetime()
{
$database = JFactory::getDBO();
$today = CitruscartHelperBase::getToday();
Citruscart::load('CitruscartHelperOrder', 'helpers.order');
$firstsale_date = CitruscartHelperOrder::getDateMarginalOrder($this->getStatesCSV(), 'ASC');
$lastsale_date = CitruscartHelperOrder::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;
}
示例2: 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 = CitruscartHelperBase::getToday();
$q = new CitruscartQuery();
$q->select('tbl.created_date AS date');
$q->from('#__citruscart_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;
}