From 4c7d9b27308608aa1659233cf2fb09c09f19a9cc Mon Sep 17 00:00:00 2001 From: Henry Whitaker Date: Fri, 3 Jul 2020 12:47:08 +0100 Subject: [PATCH] Updated latest endpoint to ignore failed tests in averages --- app/Http/Controllers/SpeedtestController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Controllers/SpeedtestController.php b/app/Http/Controllers/SpeedtestController.php index d1633a93..60774eb9 100644 --- a/app/Http/Controllers/SpeedtestController.php +++ b/app/Http/Controllers/SpeedtestController.php @@ -71,8 +71,10 @@ class SpeedtestController extends Controller { $data = SpeedtestHelper::latest(); $avg = Speedtest::select(DB::raw('AVG(ping) as ping, AVG(download) as download, AVG(upload) as upload')) + ->where('failed', false) ->get(); $max = Speedtest::select(DB::raw('MAX(ping) as ping, MAX(download) as download, MAX(upload) as upload')) + ->where('failed', false) ->get(); if($data) {