View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004572 | OXID eShop (all versions) | 2.8. Service | public | 2012-10-01 14:20 | 2013-02-07 11:55 |
Reporter | astehlik | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.6.4 revision 49061 | ||||
Target Version | 4.6.6 revision 54646 | Fixed in Version | 4.6.7 | ||
Summary | 0004572: Date errors in monthly visitor and conversion rate reports | ||||
Description | When generating reports the monthly graph for absolute visitors and the conversion rate start in the year 1970 and do not contain any data. The reason for that is, that in the used queries non-defined variables are used: admin/reports/report_conversion_rate.php admin/reports/report_visitor_absolute.php I attach a patch that fixes theses bugs. | ||||
Tags | Reports | ||||
Attached Files | oxid_report_fix.txt (2,996 bytes)
diff --git admin/reports/report_canceled_orders.php admin/reports/report_canceled_orders.php index 432645e..a58dd22 100644 --- admin/reports/report_canceled_orders.php +++ admin/reports/report_canceled_orders.php @@ -270,7 +270,7 @@ class Report_canceled_orders extends report_base $rs = oxDb::getDb()->execute( $sQ ); if ( $rs != false && $rs->recordCount() > 0 ) { while ( !$rs->EOF ) { - $sKey = oxUtilsDate::getInstance()->getWeekNumber( $myConfig->getConfigParam( 'iFirstWeekDay' ), strtotime( $rs->fields[0] ) ); + $sKey = oxUtilsDate::getInstance()->getWeekNumber( oxConfig::getConfigParam( 'iFirstWeekDay' ), strtotime( $rs->fields[0] ) ); if ( isset( $aDataX5[$sKey] ) ) { $aDataX5[$sKey]++; } diff --git admin/reports/report_conversion_rate.php admin/reports/report_conversion_rate.php index 1eba570..8f7cd63 100644 --- admin/reports/report_conversion_rate.php +++ admin/reports/report_conversion_rate.php @@ -73,8 +73,11 @@ class Report_conversion_rate extends report_base $aDataX = array(); $aDataY = array(); - $sTimeTo = $oDb->quote( date( "Y-m-d H:i:s", strtotime( oxConfig::getParameter( "time_to" ) ) ) ); - $sTimeFrom = $oDb->quote( date( "Y-m-d H:i:s", mktime( 23, 59, 59, date( "m", $dTimeTo)-12, date( "d", $dTimeTo), date( "Y", $dTimeTo)) ) ); + $dTimeTo = strtotime( oxConfig::getParameter( "time_to" ) ); + $dTimeFrom = mktime( 23, 59, 59, date( "m", $dTimeTo)-12, date( "d", $dTimeTo), date( "Y", $dTimeTo)); + + $sTimeTo = $oDb->quote( date( "Y-m-d H:i:s", $dTimeTo) ); + $sTimeFrom = $oDb->quote( date( "Y-m-d H:i:s", $dTimeFrom ) );; // orders $sSQL = "select oxtime, count(*) as nrof from oxlogs where oxtime >= $sTimeFrom and oxtime <= $sTimeTo group by oxsessid"; diff --git admin/reports/report_visitor_absolute.php admin/reports/report_visitor_absolute.php index 29c8898..fa22185 100644 --- admin/reports/report_visitor_absolute.php +++ admin/reports/report_visitor_absolute.php @@ -77,8 +77,11 @@ class Report_visitor_absolute extends report_base $aDataX = array(); $aDataY = array(); - $sTimeTo = $oDb->quote( date( "Y-m-d H:i:s", strtotime( oxConfig::getParameter( "time_to" ) ) ) ); - $sTimeFrom = $oDb->quote( date( "Y-m-d H:i:s", mktime( 23, 59, 59, date( "m", $dTimeTo ) - 12, date( "d", $dTimeTo ), date( "Y", $dTimeTo ) ) ) ); + $dTimeTo = strtotime( oxConfig::getParameter( "time_to" ) ); + $dTimeFrom = mktime( 23, 59, 59, date( "m", $dTimeTo)-12, date( "d", $dTimeTo), date( "Y", $dTimeTo)); + + $sTimeTo = $oDb->quote( date( "Y-m-d H:i:s", $dTimeTo ) ); + $sTimeFrom = $oDb->quote( date( "Y-m-d H:i:s", $dTimeFrom ) ); $sSQL = "select oxtime, count(*) as nrof from oxlogs where oxtime >= $sTimeFrom and oxtime <= $sTimeTo group by oxsessid"; $aTemp = array(); | ||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||