summaryrefslogtreecommitdiff
path: root/app/Models/StatsDAOSQLite.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-01 19:35:14 +0200
committerGravatar GitHub <noreply@github.com> 2016-10-01 19:35:14 +0200
commit0ccf100568dc76bd88443fac13c5aef15fed9ff6 (patch)
tree2b72a0afa0fc0fcbd97ed85192fa3737313e7298 /app/Models/StatsDAOSQLite.php
parent8a58795e7dfd501c6c8ac84694e695c4f0791cfb (diff)
parent32ac41439a67e2c5777f9da80324fe0bfbf394ff (diff)
Merge pull request #1195 from Alkarex/PostgreSQL
PostgreSQL
Diffstat (limited to 'app/Models/StatsDAOSQLite.php')
-rw-r--r--app/Models/StatsDAOSQLite.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Models/StatsDAOSQLite.php b/app/Models/StatsDAOSQLite.php
index e09d18c77..6cfc20463 100644
--- a/app/Models/StatsDAOSQLite.php
+++ b/app/Models/StatsDAOSQLite.php
@@ -2,6 +2,10 @@
class FreshRSS_StatsDAOSQLite extends FreshRSS_StatsDAO {
+ protected function sqlFloor($s) {
+ return "CAST(($s) AS INT)";
+ }
+
protected function calculateEntryRepartitionPerFeedPerPeriod($period, $feed = null) {
if ($feed) {
$restrict = "WHERE e.id_feed = {$feed}";
@@ -11,7 +15,7 @@ class FreshRSS_StatsDAOSQLite extends FreshRSS_StatsDAO {
$sql = <<<SQL
SELECT strftime('{$period}', e.date, 'unixepoch') AS period
, COUNT(1) AS count
-FROM {$this->prefix}entry AS e
+FROM `{$this->prefix}entry` AS e
{$restrict}
GROUP BY period
ORDER BY period ASC
@@ -26,7 +30,7 @@ SQL;
$repartition[(int) $value['period']] = (int) $value['count'];
}
- return $this->convertToSerie($repartition);
+ return $repartition;
}
}