From 181fcd98893f65a2c5159158fbfc022b4661ea13 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 13 Jun 2014 01:00:27 -0400 Subject: Refactor statistics I made a new controller to handle statistics. The old statistics have been moved in that controller and a new action has been added to display idle feeds. I also added a menu in the left panel to navigate between the statistics pages. See #90 --- app/Models/StatsDAO.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'app/Models/StatsDAO.php') diff --git a/app/Models/StatsDAO.php b/app/Models/StatsDAO.php index 60cec7847..f9f4740fd 100644 --- a/app/Models/StatsDAO.php +++ b/app/Models/StatsDAO.php @@ -180,6 +180,26 @@ SQL; $stm->execute(); return $stm->fetchAll(PDO::FETCH_ASSOC); } + + /** + * Calculates the last publication date for each feed + * + * @return array + */ + public function calculateFeedLastDate() { + $sql = <<prefix}feed AS f, +{$this->prefix}entry AS e +WHERE f.id = e.id_feed +GROUP BY f.id +ORDER BY name +SQL; + $stm = $this->bd->prepare($sql); + $stm->execute(); + return $stm->fetchAll(PDO::FETCH_ASSOC); + } private function convertToSerie($data) { $serie = array(); -- cgit v1.2.3