projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2d7110e
)
optimize
author
Ivan Kohler
<ivan@freeside.biz>
Thu, 20 Nov 2014 20:02:08 +0000
(12:02 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Thu, 20 Nov 2014 20:02:08 +0000
(12:02 -0800)
FS/FS/cust_pkg/Search.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_pkg/Search.pm
b/FS/FS/cust_pkg/Search.pm
index
9cd1ff0
..
aacd387
100644
(file)
--- a/
FS/FS/cust_pkg/Search.pm
+++ b/
FS/FS/cust_pkg/Search.pm
@@
-312,10
+312,10
@@
sub search {
if (@report_option) {
# this will result in the empty set for the dangling comma case as it should
push @where,
if (@report_option) {
# this will result in the empty set for the dangling comma case as it should
push @where,
- map{ "
0 < ( SELECT count(*)
FROM part_pkg_option
- WHERE part_pkg_option.pkgpart = part_pkg.pkgpart
- AND optionname = 'report_option_$_'
- AND optionvalue = '1' )"
+ map{ "
EXISTS ( SELECT 1
FROM part_pkg_option
+
WHERE part_pkg_option.pkgpart = part_pkg.pkgpart
+
AND optionname = 'report_option_$_'
+
AND optionvalue = '1' )"
} @report_option;
}
} @report_option;
}
@@
-331,10
+331,10
@@
sub search {
if (@report_option_any) {
# this will result in the empty set for the dangling comma case as it should
push @where, ' ( '. join(' OR ',
if (@report_option_any) {
# this will result in the empty set for the dangling comma case as it should
push @where, ' ( '. join(' OR ',
- map{ "
0 < ( SELECT count(*)
FROM part_pkg_option
- WHERE part_pkg_option.pkgpart = part_pkg.pkgpart
- AND optionname = 'report_option_$_'
- AND optionvalue = '1' )"
+ map{ "
EXISTS ( SELECT 1
FROM part_pkg_option
+
WHERE part_pkg_option.pkgpart = part_pkg.pkgpart
+
AND optionname = 'report_option_$_'
+
AND optionvalue = '1' )"
} @report_option_any
). ' ) ';
}
} @report_option_any
). ' ) ';
}