projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
244d885
)
fix day_of_month condition on mysql, #28895
author
Mark Wells
<mark@freeside.biz>
Fri, 27 Jun 2014 22:09:04 +0000
(15:09 -0700)
committer
Mark Wells
<mark@freeside.biz>
Fri, 27 Jun 2014 22:09:04 +0000
(15:09 -0700)
FS/FS/part_event/Condition/day_of_month.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_event/Condition/day_of_month.pm
b/FS/FS/part_event/Condition/day_of_month.pm
index
61cd8d6
..
036cb70
100644
(file)
--- a/
FS/FS/part_event/Condition/day_of_month.pm
+++ b/
FS/FS/part_event/Condition/day_of_month.pm
@@
-29,7
+29,11
@@
sub condition_sql {
my( $class, $table, %opt ) = @_;
my $today = (localtime($opt{'time'}))[3];
my $day = $class->condition_sql_option('day');
- "$today = ANY( string_to_array($day, ',')::integer[] )"
+ if ($opt{'driver_name'} eq 'Pg') {
+ "$today = ANY( string_to_array($day, ',')::integer[] )";
+ } elsif ( $opt{'driver_name'} eq 'mysql' ) {
+ "find_in_set($today, $day) > 0";
+ }
}
1;