projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
75873f3
)
fix search performance (and possibly results?), RT#25985, RT#25687
author
Ivan Kohler
<ivan@freeside.biz>
Fri, 15 Nov 2013 23:58:32 +0000
(15:58 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Fri, 15 Nov 2013 23:58:32 +0000
(15:58 -0800)
FS/FS/cust_main/Search.pm
patch
|
blob
|
history
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,