Skip to content
Extraits de code Groupes Projets
Valider fd41dcca rédigé par mattab's avatar mattab
Parcourir les fichiers

Minor

parent 3ecc6f3b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -129,6 +129,34 @@ class Archiver extends \Piwik\Plugin\Archiver ...@@ -129,6 +129,34 @@ class Archiver extends \Piwik\Plugin\Archiver
return " AND log_link_visit_action.idaction_event_category IS NULL"; return " AND log_link_visit_action.idaction_event_category IS NULL";
} }
/**
* @param $select
* @param $from
*/
protected function updateQuerySelectFromForSiteSearch(&$select, &$from)
{
$selectFlagNoResultKeywords = ",
CASE WHEN (MAX(log_link_visit_action.custom_var_v" . ActionSiteSearch::CVAR_INDEX_SEARCH_COUNT . ") = 0
AND log_link_visit_action.custom_var_k" . ActionSiteSearch::CVAR_INDEX_SEARCH_COUNT . " = '" . ActionSiteSearch::CVAR_KEY_SEARCH_COUNT . "')
THEN 1 ELSE 0 END
AS `" . Metrics::INDEX_SITE_SEARCH_HAS_NO_RESULT . "`";
//we need an extra JOIN to know whether the referrer "idaction_name_ref" was a Site Search request
$from[] = array(
"table" => "log_action",
"tableAlias" => "log_action_name_ref",
"joinOn" => "log_link_visit_action.idaction_name_ref = log_action_name_ref.idaction"
);
$selectPageIsFollowingSiteSearch = ",
SUM( CASE WHEN log_action_name_ref.type = " . Action::TYPE_SITE_SEARCH . "
THEN 1 ELSE 0 END)
AS `" . Metrics::INDEX_PAGE_IS_FOLLOWING_SITE_SEARCH_NB_HITS . "`";
$select .= $selectFlagNoResultKeywords
. $selectPageIsFollowingSiteSearch;
}
/** /**
* Initializes the DataTables created by the archiveDay function. * Initializes the DataTables created by the archiveDay function.
*/ */
...@@ -216,26 +244,7 @@ class Archiver extends \Piwik\Plugin\Archiver ...@@ -216,26 +244,7 @@ class Archiver extends \Piwik\Plugin\Archiver
// 1) No result Keywords // 1) No result Keywords
// 2) For each page view, count number of times the referrer page was a Site Search // 2) For each page view, count number of times the referrer page was a Site Search
if ($this->isSiteSearchEnabled()) { if ($this->isSiteSearchEnabled()) {
$selectFlagNoResultKeywords = ", $this->updateQuerySelectFromForSiteSearch($select, $from);
CASE WHEN (MAX(log_link_visit_action.custom_var_v" . ActionSiteSearch::CVAR_INDEX_SEARCH_COUNT . ") = 0
AND log_link_visit_action.custom_var_k" . ActionSiteSearch::CVAR_INDEX_SEARCH_COUNT . " = '" . ActionSiteSearch::CVAR_KEY_SEARCH_COUNT . "')
THEN 1 ELSE 0 END
AS `" . Metrics::INDEX_SITE_SEARCH_HAS_NO_RESULT . "`";
//we need an extra JOIN to know whether the referrer "idaction_name_ref" was a Site Search request
$from[] = array(
"table" => "log_action",
"tableAlias" => "log_action_name_ref",
"joinOn" => "log_link_visit_action.idaction_name_ref = log_action_name_ref.idaction"
);
$selectPageIsFollowingSiteSearch = ",
SUM( CASE WHEN log_action_name_ref.type = " . Action::TYPE_SITE_SEARCH. "
THEN 1 ELSE 0 END)
AS `" . Metrics::INDEX_PAGE_IS_FOLLOWING_SITE_SEARCH_NB_HITS . "`";
$select .= $selectFlagNoResultKeywords
. $selectPageIsFollowingSiteSearch;
} }
$this->archiveDayQueryProcess($select, $from, $where, $orderBy, $groupBy, "idaction_name", $rankingQuery); $this->archiveDayQueryProcess($select, $from, $where, $orderBy, $groupBy, "idaction_name", $rankingQuery);
......
...@@ -85,8 +85,7 @@ class Archiver extends \Piwik\Plugin\Archiver ...@@ -85,8 +85,7 @@ class Archiver extends \Piwik\Plugin\Archiver
protected function getSelectAveragePrice() protected function getSelectAveragePrice()
{ {
$field = "custom_var_v" . \PiwikTracker::CVAR_INDEX_ECOMMERCE_ITEM_PRICE; $field = "custom_var_v" . \PiwikTracker::CVAR_INDEX_ECOMMERCE_ITEM_PRICE;
return LogAggregator::getSqlRevenue("AVG(log_link_visit_action.{$field})") return LogAggregator::getSqlRevenue("AVG(log_link_visit_action." . $field . ")") . " as `" . Metrics::INDEX_ECOMMERCE_ITEM_PRICE_VIEWED . "`";
. " as `" . Metrics::INDEX_ECOMMERCE_ITEM_PRICE_VIEWED . "`";
} }
protected function aggregateFromVisits($query, $keyField, $valueField) protected function aggregateFromVisits($query, $keyField, $valueField)
......
...@@ -269,7 +269,9 @@ class LogDataPurger ...@@ -269,7 +269,9 @@ class LogDataPurger
'log_link_visit_action' => array('idaction_url', 'log_link_visit_action' => array('idaction_url',
'idaction_url_ref', 'idaction_url_ref',
'idaction_name', 'idaction_name',
'idaction_name_ref'), 'idaction_name_ref',
'idaction_event_category',
'idaction_event_action'),
'log_conversion' => array('idaction_url'), 'log_conversion' => array('idaction_url'),
......
...@@ -21,7 +21,6 @@ use Piwik\DataTable\Row; ...@@ -21,7 +21,6 @@ use Piwik\DataTable\Row;
use Piwik\DataTable; use Piwik\DataTable;
use Piwik\Metrics; use Piwik\Metrics;
use Piwik\Period; use Piwik\Period;
use Piwik\Period\Day;
use Piwik\Piwik; use Piwik\Piwik;
use Piwik\Plugins\Actions\Actions; use Piwik\Plugins\Actions\Actions;
use Piwik\Plugins\Actions\ArchivingHelper; use Piwik\Plugins\Actions\ArchivingHelper;
...@@ -149,9 +148,7 @@ class API extends \Piwik\Plugin\API ...@@ -149,9 +148,7 @@ class API extends \Piwik\Plugin\API
$id = $actionsPlugin->getIdActionFromSegment($actionName, 'idaction_name', SegmentExpression::MATCH_EQUAL, 'pageTitle'); $id = $actionsPlugin->getIdActionFromSegment($actionName, 'idaction_name', SegmentExpression::MATCH_EQUAL, 'pageTitle');
if ($id < 0) { if ($id < 0) {
$unknown = ArchivingHelper::getUnknownActionName( $unknown = ArchivingHelper::getUnknownActionName(Action::TYPE_PAGE_TITLE);
Action::TYPE_PAGE_TITLE);
if (trim($actionName) == trim($unknown)) { if (trim($actionName) == trim($unknown)) {
$id = $actionsPlugin->getIdActionFromSegment('', 'idaction_name', SegmentExpression::MATCH_EQUAL, 'pageTitle'); $id = $actionsPlugin->getIdActionFromSegment('', 'idaction_name', SegmentExpression::MATCH_EQUAL, 'pageTitle');
} }
......
<?php <?php
use Piwik\Filesystem; use Piwik\Filesystem;
use Piwik\SettingsServer; use Piwik\SettingsServer;
use Piwik\Tracker\Db;
/** /**
* Piwik - Open source web analytics * Piwik - Open source web analytics
...@@ -140,7 +139,7 @@ class ReleaseCheckListTest extends PHPUnit_Framework_TestCase ...@@ -140,7 +139,7 @@ class ReleaseCheckListTest extends PHPUnit_Framework_TestCase
public function testProfilingDisabledInProduction() public function testProfilingDisabledInProduction()
{ {
require_once 'Tracker/Db.php'; require_once 'Tracker/Db.php';
$this->assertTrue(Db::isProfilingEnabled() === false, 'SQL profiler should be disabled in production! See Db::$profiling'); $this->assertTrue(\Piwik\Tracker\Db::isProfilingEnabled() === false, 'SQL profiler should be disabled in production! See Db::$profiling');
} }
/** /**
......
...@@ -873,7 +873,7 @@ class PrivacyManagerTest extends IntegrationTestCase ...@@ -873,7 +873,7 @@ class PrivacyManagerTest extends IntegrationTestCase
// 5 entries per period w/ visits // 5 entries per period w/ visits
// + 1 entry for every period in the month (the 'done' rows) // + 1 entry for every period in the month (the 'done' rows)
// + 1 garbage metric // + 1 garbage metric
// + 2 entries per range period (4 total) + 2 'done...' entries per range period (4 total) // log_link_visit_action+ 2 entries per range period (4 total) + 2 'done...' entries per range period (4 total)
// + 2 entries per segment (2 total) + 2 'done...' entries per segment (2 total) // + 2 entries per segment (2 total) + 2 'done...' entries per segment (2 total)
return self::JAN_METRIC_ARCHIVE_COUNT * 5 + self::TOTAL_JAN_ARCHIVE_COUNT + 1 + 8 + 4; return self::JAN_METRIC_ARCHIVE_COUNT * 5 + self::TOTAL_JAN_ARCHIVE_COUNT + 1 + 8 + 4;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter