|
|
@@ -442,19 +442,17 @@ switch ($action) {
|
|
|
to_char(last_status_315_date, 'MM/DD/YYYY'::text) as last_status_315_date,last_status_315_code, last_status_loc, last_status_city, order_from,
|
|
|
f_vessel,f_voyage,dd.*
|
|
|
FROM public.online_ocean
|
|
|
- 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,act_date,act_date,description
|
|
|
- from ocean_milestone a
|
|
|
- where a.serial_no=online_ocean.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) dd 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,act_date,act_date,description
|
|
|
+ from ocean_milestone a
|
|
|
+ where a.serial_no=online_ocean.serial_no
|
|
|
+ and a.code in (select regexp_split_to_table('IFFBCF,IFFCPU,IFFREC,IFFDEP,IFFARR,IFFAFD', ','))
|
|
|
+ order by id desc limit 1) dd on true
|
|
|
$sqlWhere and last_status_315_update_time is not null";
|
|
|
if (_isDemo()) {
|
|
|
$sql .= " ORDER BY eta DESC limit " . $ps . " offset " . ($cp - 1) * $ps;
|