jaro61 Posted August 13, 2009 Share Posted August 13, 2009 In statistic Newsletter is bug. Bug is in file modules>statsnewsletter/statsnewsletter.php"Unknown column 'n.date_add' in 'where clause' SELECT COUNT(*) as visitors FROM ps_newsletter n WHERE n.`date_add` BETWEEN '2009-01-01 00:00:00' AND '2009-12-31 23:59:59'"old code: private function getTotals() { $result1 = Db::getInstance()->getRow(' SELECT COUNT(*) as customers FROM `'._DB_PREFIX_.'customer` c WHERE c.`newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween()); $result2 = Db::getInstance()->getRow(' SELECT COUNT(*) as visitors FROM '._DB_PREFIX_.'newsletter n WHERE n.`date_add` BETWEEN '.ModuleGraph::getDateBetween()); return array('customers' => $result1['customers'], 'visitors' => $result2['visitors'], 'both' => $result1['customers'] + $result2['visitors']); } new code: private function getTotals() { $result1 = Db::getInstance()->getRow(' SELECT COUNT(*) as customers FROM `'._DB_PREFIX_.'customer` c WHERE c.`newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween()); $result2 = Db::getInstance()->getRow(' SELECT COUNT(*) as visitors FROM '._DB_PREFIX_.'newsletter n WHERE n.`newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween()); return array('customers' => $result1['customers'], 'visitors' => $result2['visitors'], 'both' => $result1['customers'] + $result2['visitors']); } Link to comment Share on other sites More sharing options...
Oz Posted August 14, 2009 Share Posted August 14, 2009 Is this the fix for such problem?Please advise Link to comment Share on other sites More sharing options...
jaro61 Posted August 14, 2009 Author Share Posted August 14, 2009 Yes, find and replace part with new code. Link to comment Share on other sites More sharing options...
Oz Posted August 14, 2009 Share Posted August 14, 2009 Thank you! It worked as expected.Thanks Link to comment Share on other sites More sharing options...
Kreasite Posted August 20, 2009 Share Posted August 20, 2009 Thank you, good job.++DAV Link to comment Share on other sites More sharing options...
mhu100 Posted December 12, 2009 Share Posted December 12, 2009 Thank you, good job.++DAV It's not working for me. When Admin create a account in BO the newsletter stats aren't updated (not counting)I'm using PS 1.2.4. Link to comment Share on other sites More sharing options...
Recommended Posts