my $items = $self->db->resultset('Item')->search({},{
'+select' => ...
'join' => ...
where => {
-or => ...
'start_datetime' => {'<=' => \'NOW()'},
'end_datetime' => {'>=' => \'NOW()'},
},
group_by => ...
order_by => ...
});
####
foreach my $value(@values) {
my $results = $items->search({ 'joined_table.column' => $value });
# Process and output results of this search
...
}
####
my $results_query = $items->search({ 'joined_table.column' => '?' });
foreach my $value(@values) {
my $results = $results_query->bind($value);
# Process and output results of this search
...
}