Revision bc40bcab
Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
2227 | 2227 |
my ($table, $field) = split m/\./, $column; |
2228 | 2228 |
next if !$form->{"${field}_${i}"}; |
2229 | 2229 |
$where .= qq| AND lower(${column}) ILIKE ?|; |
2230 |
push @values, '%' . $form->{"${field}_${i}"} . '%';
|
|
2230 |
push @values, like($form->{"${field}_${i}"});
|
|
2231 | 2231 |
} |
2232 | 2232 |
|
2233 | 2233 |
my (%mm_by_id); |
... | ... | |
2239 | 2239 |
my $mm_query = qq| |
2240 | 2240 |
SELECT parts_id, model FROM makemodel LEFT JOIN parts ON parts.id = parts_id WHERE NOT parts.obsolete AND model ILIKE ?; |
2241 | 2241 |
|; |
2242 |
my $mm_results = selectall_hashref_query($::form, $dbh, $mm_query, '%' . $form->{"partnumber_$i"} . '%');
|
|
2242 |
my $mm_results = selectall_hashref_query($::form, $dbh, $mm_query, like($form->{"partnumber_$i"}));
|
|
2243 | 2243 |
my @mm_ids = map { $_->{parts_id} } @$mm_results; |
2244 | 2244 |
push @{$mm_by_id{ $_->{parts_id} } ||= []}, $_ for @$mm_results; |
2245 | 2245 |
|
Auch abrufbar als: Unified diff
(I)LIKE-Argumente immer mit Funktion SL::DBUtils::like erstellen