projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix search performance (and possibly results?), RT#25985, RT#25687
[freeside.git]
/
FS
/
FS
/
cust_main
/
Search.pm
diff --git
a/FS/FS/cust_main/Search.pm
b/FS/FS/cust_main/Search.pm
index
215fdc2
..
b143861
100644
(file)
--- a/
FS/FS/cust_main/Search.pm
+++ b/
FS/FS/cust_main/Search.pm
@@
-358,28
+358,30
@@
sub smart_search {
#substring
#substring
- my @hashrefs = (
+ my @
company_
hashrefs = (
{ 'company' => { op=>'ILIKE', value=>"%$value%" }, },
{ 'ship_company' => { op=>'ILIKE', value=>"%$value%" }, },
);
{ 'company' => { op=>'ILIKE', value=>"%$value%" }, },
{ 'ship_company' => { op=>'ILIKE', value=>"%$value%" }, },
);
+ my @hashrefs = ();
+
if ( $first && $last ) {
if ( $first && $last ) {
- push @hashrefs,
+ @hashrefs = (
{ 'first' => { op=>'ILIKE', value=>"%$first%" },
'last' => { op=>'ILIKE', value=>"%$last%" },
},
{ 'first' => { op=>'ILIKE', value=>"%$first%" },
'last' => { op=>'ILIKE', value=>"%$last%" },
},
- ;
+
)
;
} else {
} else {
- push @hashrefs,
+ @hashrefs = (
{ 'first' => { op=>'ILIKE', value=>"%$value%" }, },
{ 'last' => { op=>'ILIKE', value=>"%$value%" }, },
{ 'first' => { op=>'ILIKE', value=>"%$value%" }, },
{ 'last' => { op=>'ILIKE', value=>"%$value%" }, },
- ;
+
)
;
}
}
- foreach my $hashref ( @hashrefs ) {
+ foreach my $hashref ( @
company_hashrefs, @
hashrefs ) {
push @cust_main, qsearch( {
'table' => 'cust_main',
push @cust_main, qsearch( {
'table' => 'cust_main',
@@
-405,8
+407,6
@@
sub smart_search {
#contact substring
#contact substring
- shift @hashrefs; #no company column in contact table
-
foreach my $hashref ( @hashrefs ) {
push @cust_main,
foreach my $hashref ( @hashrefs ) {
push @cust_main,