aboutsummaryrefslogtreecommitdiff
path: root/app/Models/StatsDAO.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <github@ainw.org> 2014-11-08 09:29:51 -0500
committerGravatar Alexis Degrugillier <github@ainw.org> 2014-11-08 09:29:51 -0500
commit960abfcc6558d8421423a42b7781184dad0d9bc7 (patch)
tree3790513d3f5fe3b4a49c8c8b5bf282fff8a556af /app/Models/StatsDAO.php
parent38cf7a109ee80cc03edfd420b641676ecd1dfae6 (diff)
Refactor some if statements
Diffstat (limited to 'app/Models/StatsDAO.php')
-rw-r--r--app/Models/StatsDAO.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/Models/StatsDAO.php b/app/Models/StatsDAO.php
index 0ca251228..255a2b1ff 100644
--- a/app/Models/StatsDAO.php
+++ b/app/Models/StatsDAO.php
@@ -151,10 +151,9 @@ SQL;
* @return string
*/
protected function calculateEntryRepartitionPerFeedPerPeriod($period, $feed = null) {
+ $restrict = '';
if ($feed) {
$restrict = "WHERE e.id_feed = {$feed}";
- } else {
- $restrict = '';
}
$sql = <<<SQL
SELECT DATE_FORMAT(FROM_UNIXTIME(e.date), '{$period}') AS period
@@ -214,10 +213,9 @@ SQL;
* @return integer
*/
protected function calculateEntryAveragePerFeedPerPeriod($period, $feed = null) {
+ $restrict = '';
if ($feed) {
$restrict = "WHERE e.id_feed = {$feed}";
- } else {
- $restrict = '';
}
$sql = <<<SQL
SELECT COUNT(1) AS count