|
@@ -1252,7 +1252,7 @@ class ocean_order {
|
|
|
address_4 as aa_address_4,
|
|
address_4 as aa_address_4,
|
|
|
city as aa_city, state as aa_state, zipcode as aa_zipcode, country as aa_country,
|
|
city as aa_city, state as aa_state, zipcode as aa_zipcode, country as aa_country,
|
|
|
phone_1 as aa_phone,
|
|
phone_1 as aa_phone,
|
|
|
- (select time_zone from public.city_timezone where uncode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as aa_timezone
|
|
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = LEFT(c.country, 2) || COALESCE(c.city_code,'') limit 1) as aa_timezone
|
|
|
FROM $_schemas.contacts c WHERE o.origin_station::text = c.contact_id::text) aa ON true
|
|
FROM $_schemas.contacts c WHERE o.origin_station::text = c.contact_id::text) aa ON true
|
|
|
LEFT JOIN LATERAL ( SELECT company as dd_company,
|
|
LEFT JOIN LATERAL ( SELECT company as dd_company,
|
|
|
address_1 as dd_address_1,
|
|
address_1 as dd_address_1,
|
|
@@ -1261,11 +1261,11 @@ class ocean_order {
|
|
|
address_4 as dd_address_4,
|
|
address_4 as dd_address_4,
|
|
|
city as dd_city, state as dd_state, zipcode as dd_zipcode, country as dd_country,
|
|
city as dd_city, state as dd_state, zipcode as dd_zipcode, country as dd_country,
|
|
|
phone_1 as dd_phone,
|
|
phone_1 as dd_phone,
|
|
|
- (select time_zone from public.city_timezone where uncode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as dd_timezone
|
|
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = LEFT(c.country, 2) || COALESCE(c.city_code,'') limit 1) as dd_timezone
|
|
|
FROM $_schemas.contacts c WHERE o.destination_station::text = c.contact_id::text) dd ON true
|
|
FROM $_schemas.contacts c WHERE o.destination_station::text = c.contact_id::text) dd ON true
|
|
|
LEFT JOIN LATERAL ( SELECT
|
|
LEFT JOIN LATERAL ( SELECT
|
|
|
city as fd_city,
|
|
city as fd_city,
|
|
|
- (select time_zone from public.city_timezone where uncode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as fd_timezone
|
|
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = LEFT(c.country, 2) || COALESCE(c.city_code,'') limit 1) as fd_timezone
|
|
|
FROM $_schemas.contacts c WHERE o.final_desination::text = c.contact_id::text) fd ON true";
|
|
FROM $_schemas.contacts c WHERE o.final_desination::text = c.contact_id::text) fd ON true";
|
|
|
//error_log($sql);
|
|
//error_log($sql);
|
|
|
return $sql;
|
|
return $sql;
|