summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-12-07 19:31:13 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2019-12-07 21:29:11 +0100
commit8fc159f2872a661c83d2a0bd1f4f68f49c33ae8c (patch)
treef3558c235a438466fae138aa854ed9b93a7c86a1 /src
parente16e0b2644172f098956f6c970e86581e2e758c1 (diff)
Stats: Added questions test
Diffstat (limited to 'src')
-rw-r--r--src/Controllers/Metrics/Stats.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Controllers/Metrics/Stats.php b/src/Controllers/Metrics/Stats.php
index f1ef247b..b7aecffd 100644
--- a/src/Controllers/Metrics/Stats.php
+++ b/src/Controllers/Metrics/Stats.php
@@ -6,6 +6,7 @@ use Carbon\Carbon;
use Engelsystem\Database\Database;
use Engelsystem\Models\EventConfig;
use Engelsystem\Models\News;
+use Engelsystem\Models\Question;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Query\Expression as QueryExpression;
@@ -221,13 +222,10 @@ class Stats
/**
* @param bool $answered
* @return int
- * @codeCoverageIgnore
*/
public function questions($answered = null)
{
- $query = $this
- ->getQuery('questions');
-
+ $query = Question::query();
if (!is_null($answered)) {
if ($answered) {
$query->whereNotNull('answerer_id');