mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-04-04 22:53:27 -04:00
Stats idle feed small bug
Some feeds were listed more than once. A bit more independent from the SQL query. https://github.com/marienfressinaud/FreshRSS/issues/544
This commit is contained in:
@@ -15,7 +15,13 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
|
||||
public function idleAction() {
|
||||
$statsDAO = FreshRSS_Factory::createStatsDAO();
|
||||
$feeds = $statsDAO->calculateFeedLastDate();
|
||||
$idleFeeds = array();
|
||||
$idleFeeds = array(
|
||||
'last_year' => array(),
|
||||
'last_6_month' => array(),
|
||||
'last_3_month' => array(),
|
||||
'last_month' => array(),
|
||||
'last_week' => array(),
|
||||
);
|
||||
$now = new \DateTime();
|
||||
$feedDate = clone $now;
|
||||
$lastWeek = clone $now;
|
||||
@@ -34,24 +40,20 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
|
||||
if ($feedDate >= $lastWeek) {
|
||||
continue;
|
||||
}
|
||||
if ($feedDate < $lastWeek) {
|
||||
$idleFeeds['last_week'][] = $feed;
|
||||
}
|
||||
if ($feedDate < $lastMonth) {
|
||||
$idleFeeds['last_month'][] = $feed;
|
||||
}
|
||||
if ($feedDate < $last3Month) {
|
||||
$idleFeeds['last_3_month'][] = $feed;
|
||||
}
|
||||
if ($feedDate < $last6Month) {
|
||||
$idleFeeds['last_6_month'][] = $feed;
|
||||
}
|
||||
if ($feedDate < $lastYear) {
|
||||
$idleFeeds['last_year'][] = $feed;
|
||||
} elseif ($feedDate < $last6Month) {
|
||||
$idleFeeds['last_6_month'][] = $feed;
|
||||
} elseif ($feedDate < $last3Month) {
|
||||
$idleFeeds['last_3_month'][] = $feed;
|
||||
} elseif ($feedDate < $lastMonth) {
|
||||
$idleFeeds['last_month'][] = $feed;
|
||||
} elseif ($feedDate < $lastWeek) {
|
||||
$idleFeeds['last_week'][] = $feed;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->idleFeeds = array_reverse($idleFeeds);
|
||||
$this->view->idleFeeds = $idleFeeds;
|
||||
}
|
||||
|
||||
public function firstAction() {
|
||||
|
||||
Reference in New Issue
Block a user