ShuanghongS преди 1 месец
родител
ревизия
9f9bad19a4
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      service/ocean_order.class.php

+ 4 - 2
service/ocean_order.class.php

@@ -2368,13 +2368,15 @@ class ocean_order {
                                     union all 
                                     select serial_no from bb 
                                 ),              
-                            h as (select * from station_data.do_header h where h.serial_no = (select serial_no from cc) and from_station = '".$ocean["from_station"]."')
+                            h as (select * from station_data.do_header h where h.serial_no in (select serial_no from cc))
                     
                     select h.est_delivery_date,h.est_delivery_time,
                         h.consignee_country_code,h.consignee_city_code,
                         (select time_zone from public.city_timezone where uncode = CONCAT(h.consignee_country_code, h.consignee_city_code) limit 1) as timezone,
                         d.ctnr 
-                    from h left join station_data.do_detail d on h.id = d.do_header_id  order by h.est_delivery_date";
+                    from h left join station_data.do_detail d on h.id = d.do_header_id and h.from_station = d.from_station 
+                        where h.from_station = '".$ocean["destination_station"]."'
+                            order by h.est_delivery_date";
         // $deliverySql = "with aa as (SELECT o.serial_no, o.master_base_number from  $order_from.ocean o WHERE o.serial_no='".$ocean["serial_no"]."'),
         //                     bb as (select o.serial_no from $order_from.ocean o
         //                             where exists(select 1 from aa where aa.master_base_number= o.master_base_number)