HubStats was not limiting the scope to the date, now that the scopeUncollected..() methods dont limit by date (changed in #5a74386)

This commit is contained in:
Deon George 2023-12-14 11:33:54 +11:00
parent 5d88a5e10e
commit 301fc33d2f
1 changed files with 9 additions and 1 deletions

View File

@ -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)