|
@@ -1135,18 +1135,17 @@ class login {
|
|
|
private function getTrackingInfo($reference_number){
|
|
private function getTrackingInfo($reference_number){
|
|
|
$sql = "SELECT o.* ,sh.*, cn.* ,aa.*,dd.* ,cc.status as new_status
|
|
$sql = "SELECT o.* ,sh.*, cn.* ,aa.*,dd.* ,cc.status as new_status
|
|
|
from ocean o
|
|
from ocean o
|
|
|
- left join LATERAL (select case when a.description='Booking Confirmation' then 'Booked'
|
|
|
|
|
- when a.description='Cargo Pickup' then 'Cargo Received'
|
|
|
|
|
- when a.description='Cargo Arrived at Origin' then 'Cargo Received'
|
|
|
|
|
- when a.description='Departure' then 'Departed'
|
|
|
|
|
- when a.description='Arrived at Final Destination Port Arrived' then 'Arrived'
|
|
|
|
|
- when a.description='Arrived at Final Destination' then 'Completed'
|
|
|
|
|
- else 'Booked' END as status
|
|
|
|
|
- from ocean_milestone a
|
|
|
|
|
- where a.serial_no=o.serial_no
|
|
|
|
|
- and a.description in (
|
|
|
|
|
- select regexp_split_to_table('Booking Confirmation,Cargo Pickup,Cargo Arrived at Origin,Departure,Arrived at Final Destination Port,Arrived at Final Destination', ','))
|
|
|
|
|
- order by id desc limit 1) cc on true
|
|
|
|
|
|
|
+ left join LATERAL (select case when a.code='IFFBCF' then 'Booked'
|
|
|
|
|
+ when a.code='IFFCPU' then 'Cargo Received'
|
|
|
|
|
+ when a.code='IFFREC' then 'Cargo Received'
|
|
|
|
|
+ when a.code='IFFDEP' then 'Departed'
|
|
|
|
|
+ when a.code='IFFARR' then 'Arrived'
|
|
|
|
|
+ when a.code='IFFAFD' then 'Completed'
|
|
|
|
|
+ else 'Booked' END as status,
|
|
|
|
|
+ from ocean_milestone a
|
|
|
|
|
+ where a.serial_no=o.serial_no
|
|
|
|
|
+ and a.code in (select regexp_split_to_table('IFFBCF,IFFCPU,IFFREC,IFFDEP,IFFARR,IFFAFD', ','))
|
|
|
|
|
+ order by id desc limit 1) cc on true
|
|
|
LEFT JOIN LATERAL ( SELECT company as cn_company,
|
|
LEFT JOIN LATERAL ( SELECT company as cn_company,
|
|
|
address_1 as cn_address_1,
|
|
address_1 as cn_address_1,
|
|
|
address_2 as cn_address_2,
|
|
address_2 as cn_address_2,
|