Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/survey_server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-11-10 13:19:54 +0300
committerJoas Schilling <coding@schilljs.com>2016-11-10 13:20:48 +0300
commitd3b96220b7b26dcd7468ac690df4c38277fb3c0d (patch)
treeb8219e73f6f0508edcfc082a4dd6fc3de8e2b871 /lib
parent1060f117639a80a73ed8a48f80fe29009d12088c (diff)
Add total count to numeric stats and show stats
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/BackgroundJobs/ComputeStatistics.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/BackgroundJobs/ComputeStatistics.php b/lib/BackgroundJobs/ComputeStatistics.php
index 7ab0518..0178694 100644
--- a/lib/BackgroundJobs/ComputeStatistics.php
+++ b/lib/BackgroundJobs/ComputeStatistics.php
@@ -177,7 +177,8 @@ class ComputeStatistics extends TimedJob {
$query = $this->connection->getQueryBuilder();
$result = $query
- ->select($query->createFunction('AVG(CAST(`value` AS SIGNED)) AS average, MAX(CAST(`value` AS SIGNED)) as max, MIN(CAST(`value` AS SIGNED)) as min'))
+ ->select($query->createFunction('AVG(CAST(`value` AS SIGNED)) AS average, MAX(CAST(`value` AS SIGNED)) AS max, MIN(CAST(`value` AS SIGNED)) AS min'))
+ ->addSelect($query->createFunction('SUM(CAST(`value` AS SIGNED)) AS total'))
->from($this->table)
->where($query->expr()->eq('key', $query->createNamedParameter($key)))
->andWhere($query->expr()->eq('category', $query->createNamedParameter($category)))