当前位置: 首页>>代码示例>>PHP>>正文


PHP Request::getDaysSinceLastOrder方法代码示例

本文整理汇总了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']);
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:28,代码来源:Visit.php

示例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;
 }
开发者ID:piwik,项目名称:piwik,代码行数:14,代码来源:VisitorDaysSinceOrder.php

示例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;
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:20,代码来源:VisitorReturning.php


注:本文中的Piwik\Tracker\Request::getDaysSinceLastOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。