Revision bc40bcab
Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt
SL/IR.pm | ||
---|---|---|
1234 | 1234 |
my $field = (split m{\.}, $table_column)[1]; |
1235 | 1235 |
next unless $form->{"${field}_${i}"}; |
1236 | 1236 |
$where .= " AND lower(${table_column}) LIKE lower(?)"; |
1237 |
push @values, '%' . $form->{"${field}_${i}"} . '%';
|
|
1237 |
push @values, like($form->{"${field}_${i}"});
|
|
1238 | 1238 |
} |
1239 | 1239 |
|
1240 | 1240 |
my (%mm_by_id); |
... | ... | |
1248 | 1248 |
LEFT JOIN parts ON parts.id = parts_id |
1249 | 1249 |
WHERE NOT parts.obsolete AND model ILIKE ? AND (make IS NULL OR make = ?); |
1250 | 1250 |
|; |
1251 |
my $mm_results = selectall_hashref_query($::form, $dbh, $mm_query, '%' . $form->{"partnumber_$i"} . '%', $::form->{vendor_id});
|
|
1251 |
my $mm_results = selectall_hashref_query($::form, $dbh, $mm_query, like($form->{"partnumber_$i"}), $::form->{vendor_id});
|
|
1252 | 1252 |
my @mm_ids = map { $_->{parts_id} } @$mm_results; |
1253 | 1253 |
push @{$mm_by_id{ $_->{parts_id} } ||= []}, $_ for @$mm_results; |
1254 | 1254 |
|
Auch abrufbar als: Unified diff
(I)LIKE-Argumente immer mit Funktion SL::DBUtils::like erstellen