From d7aea575ff77cd37c326511e7ac5fe49067c63ad Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 14 Oct 2018 18:24:42 +0200 Subject: Replaced more sql queries and old data --- includes/pages/guest_stats.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'includes/pages/guest_stats.php') diff --git a/includes/pages/guest_stats.php b/includes/pages/guest_stats.php index bb07f4dc..d9012748 100644 --- a/includes/pages/guest_stats.php +++ b/includes/pages/guest_stats.php @@ -1,6 +1,8 @@ input('api_key') == $apiKey) { $stats = []; - list($user_count) = DB::select('SELECT count(*) AS `user_count` FROM `User`'); - $stats['user_count'] = $user_count['user_count']; - - list($arrived_user_count) = DB::select(' - SELECT count(*) AS `user_count` - FROM `User` - WHERE `Gekommen`=1 - '); - $stats['arrived_user_count'] = $arrived_user_count['user_count']; + $stats['user_count'] = User::all()->count(); + $stats['arrived_user_count'] = State::whereArrived(true)->count(); $done_shifts_seconds = DB::selectOne(' SELECT SUM(`Shifts`.`end` - `Shifts`.`start`) -- cgit v1.2.3-54-g00ecf