Revision eb5e6913
Von Werner Hahn vor mehr als 7 Jahren hinzugefügt
SL/DB/ShopOrder.pm | ||
---|---|---|
132 | 132 |
OR |
133 | 133 |
email ILIKE ? |
134 | 134 |
) AND obsolete = 'F' |
135 |
SQL |
|
136 |
|
|
137 |
# Fuzzysearch for street to find e.g. "Dorfstrasse - Dorfstr. - Dorfstraße" |
|
138 |
my $fs_subquery = <<SQL; |
|
139 |
SELECT id |
|
140 |
FROM customer |
|
141 |
WHERE ( |
|
142 |
( |
|
143 |
( name ILIKE ? OR name ILIKE ? ) |
|
144 |
AND |
|
145 |
zipcode ILIKE ? |
|
146 |
) |
|
147 |
OR |
|
148 |
( street % ? AND zipcode ILIKE ?) |
|
149 |
OR |
|
150 |
email ILIKE ? |
|
151 |
) AND obsolete = 'F' |
|
152 | 135 |
SQL |
153 | 136 |
|
154 | 137 |
my @values = ($lastname, $company, $self->billing_zipcode, $street, $self->billing_zipcode, $self->billing_email); |
155 | 138 |
|
156 |
my $dbh = $::form->get_standard_dbh(); |
|
157 |
my @c_ids = ( 0 ); |
|
158 |
@c_ids = selectall_array_query($::form, $dbh, $fs_subquery, @values); |
|
159 |
@c_ids = ( 0 ) if( !scalar(@c_ids) ); |
|
160 |
my $customers = SL::DB::Manager::Customer->get_all( query => [ id => [ @c_ids ] ] ); |
|
161 |
|
|
162 |
# my $customers = SL::DB::Manager::Customer->get_objects_from_sql( |
|
163 |
# sql => $fs_query, |
|
164 |
# args => \@values, |
|
165 |
#); |
|
139 |
my $customers = SL::DB::Manager::Customer->get_objects_from_sql( |
|
140 |
sql => $fs_query, |
|
141 |
args => \@values, |
|
142 |
); |
|
166 | 143 |
|
167 | 144 |
return $customers; |
168 | 145 |
} |
Auch abrufbar als: Unified diff
Shopmodul: get_objects_from_sql wieder aktiviert. Vorhergehender Fehler
lag an alter DB mit crm tbln und spltn