Lines 116-130
sub _get_domain_count {
Link Here
|
116 |
} keys %$limits; |
116 |
} keys %$limits; |
117 |
|
117 |
|
118 |
my $sum = 0; |
118 |
my $sum = 0; |
119 |
my $dt_parser = Koha::Database->new->schema->storage->datetime_parser; |
|
|
120 |
my $start_dt = _convert_unit( undef, $limits->{$group}->{unit} ); |
119 |
my $start_dt = _convert_unit( undef, $limits->{$group}->{unit} ); |
121 |
foreach my $domain ( @domains ) { |
120 |
foreach my $domain ( @domains ) { |
122 |
$sum += Koha::Notice::Messages->search({ |
121 |
$sum += Koha::Notice::Messages->search( |
123 |
message_transport_type => 'email', |
122 |
{ |
124 |
status => 'sent', |
123 |
message_transport_type => 'email', |
125 |
to_address => { 'LIKE', '%'.$domain }, |
124 |
status => 'sent', |
126 |
updated_on => { '>=', $dt_parser->format_datetime($start_dt) }, # FIXME Would be nice if possible via filter_by_last_update |
125 |
to_address => { 'LIKE', '%' . $domain }, |
127 |
})->count; |
126 |
} |
|
|
127 |
)->filter_by_last_update( { timestamp_column_name => 'updated_on', from => $start_dt } )->count; |
128 |
} |
128 |
} |
129 |
$limits->{$group}->{count} = $sum; |
129 |
$limits->{$group}->{count} = $sum; |
130 |
} |
130 |
} |
131 |
- |
|
|