diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-12-25 20:56:46 +0100 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2018-12-25 20:56:46 +0100 |
commit | 26f58b8156324f09f5fc24680b45b844f6998fd6 (patch) | |
tree | f60cabadbde10b3d810ca42367b66dfea7457bed /src | |
parent | 31d9efb2b89682dac5dea52cfdb7873a9c4fa642 (diff) |
metrics: Fix users stats
Diffstat (limited to 'src')
-rw-r--r-- | src/Controllers/Metrics/Stats.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Controllers/Metrics/Stats.php b/src/Controllers/Metrics/Stats.php index 11643e46..c841be10 100644 --- a/src/Controllers/Metrics/Stats.php +++ b/src/Controllers/Metrics/Stats.php @@ -37,7 +37,7 @@ class Stats $query ->leftJoin('UserWorkLog', 'UserWorkLog.user_id', '=', 'users.id') ->leftJoin('ShiftEntry', 'ShiftEntry.UID', '=', 'users.id') - ->groupBy('users.id'); + ->distinct(); $query->where(function ($query) use ($working) { /** @var QueryBuilder $query */ @@ -48,6 +48,7 @@ class Stats return; } + $query ->whereNull('ShiftEntry.SID') ->whereNull('UserWorkLog.work_hours'); @@ -56,7 +57,7 @@ class Stats } return $query - ->count(); + ->count('users.id'); } /** |