mod_lcr: update custom_sql syntax
This commit is contained in:
parent
d8facbcf71
commit
e3654d611c
|
@ -25,10 +25,19 @@
|
||||||
=============================================================
|
=============================================================
|
||||||
<profile name="pg_prefix">
|
<profile name="pg_prefix">
|
||||||
<param name="custom_sql" value="
|
<param name="custom_sql" value="
|
||||||
SELECT l.digits, c.carrier_name, l.rate, cg.prefix AS gw_prefix, cg.suffix AS gw_suffix, l.lead_strip, l.trail_strip, l.prefix, l.suffix
|
SELECT l.digits AS lcr_digits,
|
||||||
FROM lcr l JOIN carriers c ON l.carrier_id=c.id JOIN carrier_gateway cg ON c.id=cg.carrier_id WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1' AND digits_prefix @> '%q'
|
c.carrier_name AS lcr_carrier_name,
|
||||||
AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
|
l.${lcr_rate_field} as lcr_rate_field,
|
||||||
ORDER BY digits DESC, random();
|
cg.prefix AS lcr_gw_prefix, cg.suffix AS lcr_gw_suffix,
|
||||||
|
l.lead_strip AS lcr_lead_strip, l.trail_strip AS lcr_trail_strip,
|
||||||
|
l.prefix AS lcr_prefix, l.suffix AS lcr_suffix
|
||||||
|
FROM lcr l
|
||||||
|
JOIN carriers c ON l.carrier_id=c.id
|
||||||
|
JOIN carrier_gateway cg ON c.id=cg.carrier_id
|
||||||
|
WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1'
|
||||||
|
AND digits_prefix @> %q
|
||||||
|
AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
|
||||||
|
ORDER BY digits DESC, ${lcr_rate_field}, random();
|
||||||
"/>
|
"/>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
|
@ -39,10 +48,19 @@ ORDER BY digits DESC, random();
|
||||||
=============================================================
|
=============================================================
|
||||||
<profile name="pg_prefix2">
|
<profile name="pg_prefix2">
|
||||||
<param name="custom_sql" value="
|
<param name="custom_sql" value="
|
||||||
SELECT l.digits, c.carrier_name, l.rate, cg.prefix AS gw_prefix, cg.suffix AS gw_suffix, l.lead_strip, l.trail_strip, l.prefix, l.suffix
|
SELECT l.digits AS lcr_digits,
|
||||||
FROM lcr l JOIN carriers c ON l.carrier_id=c.id JOIN carrier_gateway cg ON c.id=cg.carrier_id WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1' AND digits_prefix @> '${lcr_query_digits}'
|
c.carrier_name AS lcr_carrier_name,
|
||||||
AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
|
l.${lcr_rate_field} as lcr_rate_field,
|
||||||
ORDER BY digits DESC, random();
|
cg.prefix AS lcr_gw_prefix, cg.suffix AS lcr_gw_suffix,
|
||||||
|
l.lead_strip AS lcr_lead_strip, l.trail_strip AS lcr_trail_strip,
|
||||||
|
l.prefix AS lcr_prefix, l.suffix AS lcr_suffix
|
||||||
|
FROM lcr l
|
||||||
|
JOIN carriers c ON l.carrier_id=c.id
|
||||||
|
JOIN carrier_gateway cg ON c.id=cg.carrier_id
|
||||||
|
WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1'
|
||||||
|
AND digits_prefix @> '${lcr_query_digits}'
|
||||||
|
AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
|
||||||
|
ORDER BY digits DESC, ${lcr_rate_field}, random();
|
||||||
"/>
|
"/>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
|
@ -51,10 +69,19 @@ ORDER BY digits DESC, random();
|
||||||
=============================================================
|
=============================================================
|
||||||
<profile name="inlist">
|
<profile name="inlist">
|
||||||
<param name="custom_sql" value="
|
<param name="custom_sql" value="
|
||||||
SELECT l.digits, c.carrier_name, l.rate, cg.prefix AS gw_prefix, cg.suffix AS gw_suffix, l.lead_strip, l.trail_strip, l.prefix, l.suffix
|
SELECT l.digits AS lcr_digits,
|
||||||
FROM lcr l JOIN carriers c ON l.carrier_id=c.id JOIN carrier_gateway cg ON c.id=cg.carrier_id WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1' AND digits IN (${lcr_query_expanded_digits})
|
c.carrier_name AS lcr_carrier_name,
|
||||||
AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
|
l.${lcr_rate_field} as lcr_rate_field,
|
||||||
ORDER BY digits DESC, random();
|
cg.prefix AS lcr_gw_prefix, cg.suffix AS lcr_gw_suffix,
|
||||||
|
l.lead_strip AS lcr_lead_strip, l.trail_strip AS lcr_trail_strip,
|
||||||
|
l.prefix AS lcr_prefix, l.suffix AS lcr_suffix
|
||||||
|
FROM lcr l
|
||||||
|
JOIN carriers c ON l.carrier_id=c.id
|
||||||
|
JOIN carrier_gateway cg ON c.id=cg.carrier_id
|
||||||
|
WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1'
|
||||||
|
AND digits IN (${lcr_query_expanded_digits})
|
||||||
|
AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
|
||||||
|
ORDER BY digits DESC, ${lcr_rate_field}, random();
|
||||||
"/>
|
"/>
|
||||||
</profile>
|
</profile>
|
||||||
-->
|
-->
|
||||||
|
|
Loading…
Reference in New Issue