From 301fc33d2f096a461aff36e1e36f73c7522838f3 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 14 Dec 2023 11:33:54 +1100 Subject: [PATCH] HubStats was not limiting the scope to the date, now that the scopeUncollected..() methods dont limit by date (changed in #5a74386) --- app/Classes/Dynamic/HubStats.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Classes/Dynamic/HubStats.php b/app/Classes/Dynamic/HubStats.php index 3258b34..5ba653a 100644 --- a/app/Classes/Dynamic/HubStats.php +++ b/app/Classes/Dynamic/HubStats.php @@ -46,7 +46,15 @@ class HubStats extends Dynamic DB::raw('sum(a.uncollected_netmail) as uncollected_netmail'), DB::raw('sum(a.uncollected_files) as uncollected_files') ]) - ->from(Address::UncollectedEchomail()->union(Address::UncollectedNetmail())->union(Address::UncollectedFiles()),'a') + ->from( + Address::UncollectedEchomail() + ->where('echomails.created_at','<',$date) + ->union(Address::UncollectedNetmail() + ->where('netmails.created_at','<',$date) + ) + ->union(Address::UncollectedFiles() + ->where('files.created_at','<',$date) + ),'a') ->where('systems.active',true) ->where('addresses.active',TRUE) ->where('zones.active',TRUE)