projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9a42cc8
)
add start of torrus srvderive daemon, RT#10574
author
ivan
<ivan>
Sun, 27 Feb 2011 03:26:57 +0000
(
03:26
+0000)
committer
ivan
<ivan>
Sun, 27 Feb 2011 03:26:57 +0000
(
03:26
+0000)
FS/bin/freeside-torrus-srvderive
patch
|
blob
|
history
diff --git
a/FS/bin/freeside-torrus-srvderive
b/FS/bin/freeside-torrus-srvderive
index
895cc24
..
50dcb92
100644
(file)
--- a/
FS/bin/freeside-torrus-srvderive
+++ b/
FS/bin/freeside-torrus-srvderive
@@
-39,11
+39,14
@@
my $other_date = concat_sql([ 'other.srv_date', "' '", 'other.srv_time' ]);
$other_date = "CAST( $other_date AS TIMESTAMP )" if driver_name =~ /^Pg/i;
$other_date = str2time_sql. $other_date. str2time_sql_closing;
$other_date = "CAST( $other_date AS TIMESTAMP )" if driver_name =~ /^Pg/i;
$other_date = str2time_sql. $other_date. str2time_sql_closing;
+my $in = concat_sql([ '?', "'_IN'" )
+my $out = concat_sql([ '?', "'_OUT'" )
+
my $sql = "
SELECT DISTINCT srv_date, srv_time FROM srvexport
WHERE NOT EXISTS (
SELECT 1 FROM srvexport AS other
my $sql = "
SELECT DISTINCT srv_date, srv_time FROM srvexport
WHERE NOT EXISTS (
SELECT 1 FROM srvexport AS other
- WHERE other.serviceid IN (
?||'_IN', ?||'_OUT'
)
+ WHERE other.serviceid IN (
$in, $out
)
AND ABS( $_date - $other_date ) <= 60
)
ORDER BY id
AND ABS( $_date - $other_date ) <= 60
)
ORDER BY id