diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-12-19 05:10:38 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-12-19 05:37:55 +0300 |
commit | 905b84735d0070faa597933903499e4a93f99bd2 (patch) | |
tree | a6b6d1211bf92c9db08b3ad70d7e835cceeb7ed0 /plugins/Live | |
parent | 26e403bdf41ac9ba25585009c8d8dd5387b42cae (diff) |
refs #5808 if there are many logs having the same server time, sort them by the autoincrement id
Diffstat (limited to 'plugins/Live')
-rw-r--r-- | plugins/Live/Model.php | 5 | ||||
-rw-r--r-- | plugins/Live/Visitor.php | 23 |
2 files changed, 22 insertions, 6 deletions
diff --git a/plugins/Live/Model.php b/plugins/Live/Model.php index 81215f864c..19a44ba1d6 100644 --- a/plugins/Live/Model.php +++ b/plugins/Live/Model.php @@ -48,6 +48,7 @@ class Model log_action.url_prefix, log_action_title.name AS pageTitle, log_action.idaction AS pageIdAction, + log_link_visit_action.idlink_va, log_link_visit_action.server_time as serverTimePretty, log_link_visit_action.time_spent_ref_action as timeSpentRef, log_link_visit_action.idlink_va AS pageId, @@ -86,6 +87,7 @@ class Model goal.name as goalName, goal.idgoal as goalId, goal.revenue as revenue, + log_conversion.idlink_va, log_conversion.idlink_va as goalPageId, log_conversion.server_time as serverTimePretty, log_conversion.url as url @@ -123,7 +125,8 @@ class Model " . LogAggregator::getSqlRevenue('revenue_shipping') . " as revenueShipping, " . LogAggregator::getSqlRevenue('revenue_discount') . " as revenueDiscount, items as items, - log_conversion.server_time as serverTimePretty + log_conversion.server_time as serverTimePretty, + log_conversion.idlink_va FROM " . Common::prefixTable('log_conversion') . " AS log_conversion WHERE idvisit = ? AND idgoal <= " . GoalManager::IDGOAL_ORDER . " diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php index eec1ecb6ce..e1ab974efd 100644 --- a/plugins/Live/Visitor.php +++ b/plugins/Live/Visitor.php @@ -360,6 +360,10 @@ class Visitor implements VisitorInterface usort($actions, array('static', 'sortByServerTime')); + foreach ($actions as &$action) { + unset($action['idlink_va']); + } + $visitorDetailsArray['actionDetails'] = $actions; foreach ($visitorDetailsArray['actionDetails'] as &$details) { switch ($details['type']) { @@ -415,10 +419,19 @@ class Visitor implements VisitorInterface { $ta = strtotime($a['serverTimePretty']); $tb = strtotime($b['serverTimePretty']); - return $ta < $tb - ? -1 - : ($ta == $tb - ? 0 - : 1); + + if ($ta < $tb) { + return -1; + } + + if ($ta == $tb) { + if ($a['idlink_va'] > $b['idlink_va']) { + return 1; + } + + return -1; + } + + return 1; } } |