Bug 33843: Use filter_by_last_update in Koha::Notice::Util
Resolve FIXME in sub _get_domain_count by using new logic from bug 33837. Test plan: Run t/db_dependent/Koha/Notice_Util.t. This triggers the _get_domain_count call using the filter. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
9e4b0c4c72
commit
3d3e28c7bb
1 changed files with 7 additions and 7 deletions
|
@ -116,15 +116,15 @@ sub _get_domain_count {
|
|||
} keys %$limits;
|
||||
|
||||
my $sum = 0;
|
||||
my $dt_parser = Koha::Database->new->schema->storage->datetime_parser;
|
||||
my $start_dt = _convert_unit( undef, $limits->{$group}->{unit} );
|
||||
foreach my $domain ( @domains ) {
|
||||
$sum += Koha::Notice::Messages->search({
|
||||
message_transport_type => 'email',
|
||||
status => 'sent',
|
||||
to_address => { 'LIKE', '%'.$domain },
|
||||
updated_on => { '>=', $dt_parser->format_datetime($start_dt) }, # FIXME Would be nice if possible via filter_by_last_update
|
||||
})->count;
|
||||
$sum += Koha::Notice::Messages->search(
|
||||
{
|
||||
message_transport_type => 'email',
|
||||
status => 'sent',
|
||||
to_address => { 'LIKE', '%' . $domain },
|
||||
}
|
||||
)->filter_by_last_update( { timestamp_column_name => 'updated_on', from => $start_dt } )->count;
|
||||
}
|
||||
$limits->{$group}->{count} = $sum;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue