本文整理汇总了PHP中Piwik\Tracker\Request::getDaysSinceLastOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getDaysSinceLastOrder方法的具体用法?PHP Request::getDaysSinceLastOrder怎么用?PHP Request::getDaysSinceLastOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Tracker\Request
的用法示例。
在下文中一共展示了Request::getDaysSinceLastOrder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNewVisitorInformation
protected function getNewVisitorInformation($action)
{
$actionType = $idActionName = $idActionUrl = false;
if ($action) {
$idActionUrl = $action->getIdActionUrlForEntryAndExitIds();
$idActionName = $action->getIdActionNameForEntryAndExitIds();
$actionType = $action->getActionType();
}
$daysSinceFirstVisit = $this->request->getDaysSinceFirstVisit();
$visitCount = $this->request->getVisitCount();
$daysSinceLastVisit = $this->request->getDaysSinceLastVisit();
$daysSinceLastOrder = $this->request->getDaysSinceLastOrder();
$isReturningCustomer = $daysSinceLastOrder !== false;
if ($daysSinceLastOrder === false) {
$daysSinceLastOrder = 0;
}
// User settings
$userInfo = $this->getSettingsObject();
$userInfo = $userInfo->getInfo();
// Referrer data
$referrer = new Referrer();
$referrerUrl = $this->request->getParam('urlref');
$currentUrl = $this->request->getParam('url');
$referrerInfo = $referrer->getReferrerInformation($referrerUrl, $currentUrl, $this->request->getIdSite());
$visitorReturning = $isReturningCustomer ? 2 : ($visitCount > 1 || $this->isVisitorKnown() || $daysSinceLastVisit > 0 ? 1 : 0);
$defaultTimeOnePageVisit = Config::getInstance()->Tracker['default_time_one_page_visit'];
return array('idsite' => $this->request->getIdSite(), 'visitor_localtime' => $this->request->getLocalTime(), 'idvisitor' => $this->getVisitorIdcookie(), 'visitor_returning' => $visitorReturning, 'visitor_count_visits' => $visitCount, 'visitor_days_since_last' => $daysSinceLastVisit, 'visitor_days_since_order' => $daysSinceLastOrder, 'visitor_days_since_first' => $daysSinceFirstVisit, 'visit_first_action_time' => Tracker::getDatetimeFromTimestamp($this->request->getCurrentTimestamp()), 'visit_last_action_time' => Tracker::getDatetimeFromTimestamp($this->request->getCurrentTimestamp()), 'visit_entry_idaction_url' => (int) $idActionUrl, 'visit_entry_idaction_name' => (int) $idActionName, 'visit_exit_idaction_url' => (int) $idActionUrl, 'visit_exit_idaction_name' => (int) $idActionName, 'visit_total_actions' => in_array($actionType, array(Action::TYPE_PAGE_URL, Action::TYPE_DOWNLOAD, Action::TYPE_OUTLINK, Action::TYPE_SITE_SEARCH, Action::TYPE_EVENT)) ? 1 : 0, 'visit_total_searches' => $actionType == Action::TYPE_SITE_SEARCH ? 1 : 0, 'visit_total_events' => $actionType == Action::TYPE_EVENT ? 1 : 0, 'visit_total_time' => self::cleanupVisitTotalTime($defaultTimeOnePageVisit), 'visit_goal_buyer' => $this->goalManager->getBuyerType(), 'referer_type' => $referrerInfo['referer_type'], 'referer_name' => $referrerInfo['referer_name'], 'referer_url' => $referrerInfo['referer_url'], 'referer_keyword' => $referrerInfo['referer_keyword'], 'config_id' => $userInfo['config_id'], 'config_os' => $userInfo['config_os'], 'config_browser_name' => $userInfo['config_browser_name'], 'config_browser_version' => $userInfo['config_browser_version'], 'config_resolution' => $userInfo['config_resolution'], 'config_pdf' => $userInfo['config_pdf'], 'config_flash' => $userInfo['config_flash'], 'config_java' => $userInfo['config_java'], 'config_director' => $userInfo['config_director'], 'config_quicktime' => $userInfo['config_quicktime'], 'config_realplayer' => $userInfo['config_realplayer'], 'config_windowsmedia' => $userInfo['config_windowsmedia'], 'config_gears' => $userInfo['config_gears'], 'config_silverlight' => $userInfo['config_silverlight'], 'config_cookie' => $userInfo['config_cookie'], 'location_ip' => $this->getVisitorIp(), 'location_browser_lang' => $userInfo['location_browser_lang']);
}
示例2: onNewVisit
/**
* @param Request $request
* @param Visitor $visitor
* @param Action|null $action
* @return mixed
*/
public function onNewVisit(Request $request, Visitor $visitor, $action)
{
$daysSinceLastOrder = $request->getDaysSinceLastOrder();
if ($daysSinceLastOrder === false) {
$daysSinceLastOrder = 0;
}
return $daysSinceLastOrder;
}
示例3: onNewVisit
/**
* @param Request $request
* @param Visitor $visitor
* @param Action|null $action
* @return mixed
*/
public function onNewVisit(Request $request, Visitor $visitor, $action)
{
$visitCount = $request->getVisitCount();
$daysSinceLastVisit = $request->getDaysSinceLastVisit();
$daysSinceLastOrder = $request->getDaysSinceLastOrder();
$isReturningCustomer = $daysSinceLastOrder !== false;
if ($isReturningCustomer) {
return self::IS_RETURNING_CUSTOMER;
}
if ($visitCount > 1 || $visitor->isVisitorKnown() || $daysSinceLastVisit > 0) {
return self::IS_RETURNING;
}
return self::IS_NEW;
}