INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(1042, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 06:59:58'),
(1043, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 06:59:58'),
(1044, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 06:59:58'),
(1045, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 06:59:59'),
(1046, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:00:00'),
(1047, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:00:16'),
(1048, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:00:19'),
(1049, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:00:23'),
(1050, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 297\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:00:24'),
(1051, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 297 \r\nand flights.arrival_city_id = 795\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:00:25'),
(1052, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:00:26'),
(1053, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:00:29'),
(1054, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:00:34'),
(1055, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:00:34'),
(1056, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:00:34'),
(1057, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:00:34'),
(1058, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:00:35'),
(1059, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:00:51'),
(1060, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:00:58'),
(1061, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:02:36'),
(1062, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:02:39'),
(1063, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:02:40'),
(1064, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-20\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-20\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-20\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-20\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:02:42'),
(1065, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-20\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=393\r\n                            and arrival_airport_id=1700\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-20\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-20\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-20\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:02:43'),
(1066, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:02:43'),
(1067, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:02:43'),
(1068, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:02:43'),
(1069, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:02:43'),
(1070, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:02:44'),
(1071, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:03:59'),
(1072, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:04:02'),
(1073, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:04:09'),
(1074, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:04:10'),
(1075, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:04:12'),
(1076, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:04:15'),
(1077, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:04:16');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(1078, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:04:18'),
(1079, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:04:39'),
(1080, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:04:40'),
(1081, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:04:41'),
(1082, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:04:43'),
(1083, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:04:43'),
(1084, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:04:45'),
(1085, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:04:53'),
(1086, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:04:55'),
(1087, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:04:59'),
(1088, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:05:00'),
(1089, 'main_getTicketReturnAvailableDate', 'select flights.trip_duration as return_in_days from flights as flights\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nAND flights.return_flight = 1\r\nand flights.status = 1 group by flights.trip_duration order by trip_duration ASC', '2021-07-16 07:05:02'),
(1090, 'main_return_getSearchData', 'SELECT  (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,USER.company_name, USER.role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,SINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.id as flight_id,FGT.user_id,FGT.flight_number,FGT.ret_dep_ter_no_id,FGT.ret_arv_ter_no_id,FGT.name,FGT.airline_id,FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_dep_time as return_dep_time,FGT.ret_arv_time as ret_arv_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name,arrival_airports.airport_code as arrival_airport_code,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code ,PSA.available_seats as total_available_seats,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date ,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,return_departure_city.name as return_departure_city_name,return_arrival_city.name as return_arrival_city_name,return_departure_airports.name as return_departure_airport_name,return_departure_airports.airport_code as return_departure_airport_code,return_arrival_airports.name as return_arrival_airport_name,return_arrival_airports.airport_code as return_arrival_airport_code FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\nINNER join cities as return_departure_city on return_departure_city.id = FGT.re_dep_city \r\nINNER join cities as  return_arrival_city on return_arrival_city.id = FGT.re_arr_city \r\nINNER join airports as  return_departure_airports on return_departure_airports.id = FGT.re_dep_airport_id\r\nINNER join airports as  return_arrival_airports on return_arrival_airports.id = FGT.re_arr_airport_id \r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id\r\nINNER join flght_api_settings as FAS on FAS.user_id =  1\r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id\r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id\r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-23\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=1 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-23\' \r\n and PSA.available_seats > 0\r\nand FPNR.available_seat > 0 \r\nand FPNR.date =\'2021-07-23\'\r\n and FPNR.return_dep_date=\'2021-07-24\'\r\n and SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FARETAX.date =\'2021-07-23\' \r\ngroup by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:05:05'),
(1091, 'main_return_getSearchData', 'SELECT  (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,USER.company_name, USER.role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,SINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.id as flight_id,FGT.user_id,FGT.flight_number,FGT.ret_dep_ter_no_id,FGT.ret_arv_ter_no_id,FGT.name,FGT.airline_id,FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_dep_time as return_dep_time,FGT.ret_arv_time as ret_arv_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name,arrival_airports.airport_code as arrival_airport_code,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code ,PSA.available_seats as total_available_seats,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date ,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,return_departure_city.name as return_departure_city_name,return_arrival_city.name as return_arrival_city_name,return_departure_airports.name as return_departure_airport_name,return_departure_airports.airport_code as return_departure_airport_code,return_arrival_airports.name as return_arrival_airport_name,return_arrival_airports.airport_code as return_arrival_airport_code FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\nINNER join cities as return_departure_city on return_departure_city.id = FGT.re_dep_city \r\nINNER join cities as  return_arrival_city on return_arrival_city.id = FGT.re_arr_city \r\nINNER join airports as  return_departure_airports on return_departure_airports.id = FGT.re_dep_airport_id\r\nINNER join airports as  return_arrival_airports on return_arrival_airports.id = FGT.re_arr_airport_id \r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id\r\nINNER join flght_api_settings as FAS on FAS.user_id =  1\r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id\r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id\r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-23\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=1 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-23\' \r\n and PSA.available_seats > 0\r\nand FPNR.available_seat > 0 \r\nand FPNR.date =\'2021-07-23\'\r\n and FPNR.return_dep_date=\'2021-07-24\'\r\n and SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FARETAX.date =\'2021-07-23\' \r\ngroup by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:05:05'),
(1092, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:05:05'),
(1093, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:05:05'),
(1094, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:05:06'),
(1095, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:05:06'),
(1096, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:05:06'),
(1097, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:05:09'),
(1098, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:05:13'),
(1099, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:06:55'),
(1100, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:06:56'),
(1101, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:06:59'),
(1102, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:07:02'),
(1103, 'main_getTicketReturnAvailableDate', 'select flights.trip_duration as return_in_days from flights as flights\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nAND flights.return_flight = 1\r\nand flights.status = 1 group by flights.trip_duration order by trip_duration ASC', '2021-07-16 07:07:03'),
(1104, 'main_return_getSearchData', 'SELECT  (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,USER.company_name, USER.role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,SINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.id as flight_id,FGT.user_id,FGT.flight_number,FGT.ret_dep_ter_no_id,FGT.ret_arv_ter_no_id,FGT.name,FGT.airline_id,FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_dep_time as return_dep_time,FGT.ret_arv_time as ret_arv_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name,arrival_airports.airport_code as arrival_airport_code,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code ,PSA.available_seats as total_available_seats,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date ,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,return_departure_city.name as return_departure_city_name,return_arrival_city.name as return_arrival_city_name,return_departure_airports.name as return_departure_airport_name,return_departure_airports.airport_code as return_departure_airport_code,return_arrival_airports.name as return_arrival_airport_name,return_arrival_airports.airport_code as return_arrival_airport_code FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\nINNER join cities as return_departure_city on return_departure_city.id = FGT.re_dep_city \r\nINNER join cities as  return_arrival_city on return_arrival_city.id = FGT.re_arr_city \r\nINNER join airports as  return_departure_airports on return_departure_airports.id = FGT.re_dep_airport_id\r\nINNER join airports as  return_arrival_airports on return_arrival_airports.id = FGT.re_arr_airport_id \r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id\r\nINNER join flght_api_settings as FAS on FAS.user_id =  1\r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id\r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id\r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-22\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=1 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-22\' \r\n and PSA.available_seats > 0\r\nand FPNR.available_seat > 0 \r\nand FPNR.date =\'2021-07-22\'\r\n and FPNR.return_dep_date=\'2021-07-23\'\r\n and SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FARETAX.date =\'2021-07-22\' \r\ngroup by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:07:07'),
(1105, 'main_return_getSearchData', 'SELECT  (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,USER.company_name, USER.role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,SINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.id as flight_id,FGT.user_id,FGT.flight_number,FGT.ret_dep_ter_no_id,FGT.ret_arv_ter_no_id,FGT.name,FGT.airline_id,FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_dep_time as return_dep_time,FGT.ret_arv_time as ret_arv_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name,arrival_airports.airport_code as arrival_airport_code,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code ,PSA.available_seats as total_available_seats,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date ,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,return_departure_city.name as return_departure_city_name,return_arrival_city.name as return_arrival_city_name,return_departure_airports.name as return_departure_airport_name,return_departure_airports.airport_code as return_departure_airport_code,return_arrival_airports.name as return_arrival_airport_name,return_arrival_airports.airport_code as return_arrival_airport_code FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\nINNER join cities as return_departure_city on return_departure_city.id = FGT.re_dep_city \r\nINNER join cities as  return_arrival_city on return_arrival_city.id = FGT.re_arr_city \r\nINNER join airports as  return_departure_airports on return_departure_airports.id = FGT.re_dep_airport_id\r\nINNER join airports as  return_arrival_airports on return_arrival_airports.id = FGT.re_arr_airport_id \r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id\r\nINNER join flght_api_settings as FAS on FAS.user_id =  1\r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id\r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id\r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-22\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=1 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,12)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-22\' \r\n and PSA.available_seats > 0\r\nand FPNR.available_seat > 0 \r\nand FPNR.date =\'2021-07-22\'\r\n and FPNR.return_dep_date=\'2021-07-23\'\r\n and SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FARETAX.date =\'2021-07-22\' \r\ngroup by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:07:07'),
(1106, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:07:07'),
(1107, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:07:07'),
(1108, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:07:07');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(1109, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:07:07'),
(1110, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:07:08'),
(1111, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:07:10'),
(1112, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:07:12'),
(1113, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:07:26'),
(1114, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:07:28'),
(1115, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=3  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:07:43'),
(1116, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=3  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:07:46'),
(1117, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:08:19'),
(1118, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:08:19'),
(1119, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:08:20'),
(1120, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:10:07'),
(1121, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:10:13'),
(1122, 'front_frontGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and  SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)\r\nand  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:10:25'),
(1123, 'front_frontGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:10:29'),
(1124, 'front_frontGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:10:47'),
(1125, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:10:58'),
(1126, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:10:58'),
(1127, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:10:58'),
(1128, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=3  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:11:00'),
(1129, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=3  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:11:03'),
(1130, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:11:17'),
(1131, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:11:19'),
(1132, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:11:22'),
(1133, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:11:22'),
(1134, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:11:23'),
(1135, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:11:35'),
(1136, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:11:35'),
(1137, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:11:36'),
(1138, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:12:24'),
(1139, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:12:24'),
(1140, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:12:24'),
(1141, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:13:24'),
(1142, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:13:25'),
(1143, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:13:26'),
(1144, 'main_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = 1\r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=4\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,10) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-30\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-30\'\r\nand FARETAX.date =\'2021-07-30\' group by FGT.id', '2021-07-16 07:16:06'),
(1145, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:16:13'),
(1146, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:16:22');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(1147, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:16:25'),
(1148, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:16:26'),
(1149, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:16:27'),
(1150, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:16:31'),
(1151, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2) \r\n                            and SINVEN.id IN  (9)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:16:32'),
(1152, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 1010\r\n                            and departure_airport_id=2110\r\n                            and  arrival_city_id=1740\r\n                            and arrival_airport_id=1394\r\n                            and FGT.user_id IN (2) \r\n                            and SINVEN.id IN  (9)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:16:32'),
(1153, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:16:32'),
(1154, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:16:32'),
(1155, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:16:32'),
(1156, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:16:32'),
(1157, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:16:33'),
(1158, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:16:39'),
(1159, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=3  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:19:10'),
(1160, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:22:00'),
(1161, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:22:02'),
(1162, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:22:04'),
(1163, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:22:52'),
(1164, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:22:52'),
(1165, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:22:52'),
(1166, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:22:53'),
(1167, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:22:53'),
(1168, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:22:53'),
(1169, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:22:58'),
(1170, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=3  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:23:09'),
(1171, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=3  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (3,2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:23:15'),
(1172, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (3,2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:23:16'),
(1173, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:23:39'),
(1174, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:24:40'),
(1175, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:24:40'),
(1176, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:24:40'),
(1177, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:24:41'),
(1178, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:24:41'),
(1179, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:25:01'),
(1180, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:25:01'),
(1181, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:25:02'),
(1182, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:25:02'),
(1183, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:25:02'),
(1184, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:25:31');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(1185, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:25:31'),
(1186, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:25:32'),
(1187, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:25:32'),
(1188, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:25:32'),
(1189, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:25:49'),
(1190, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:25:49'),
(1191, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC', '2021-07-16 07:25:50'),
(1192, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:25:50'),
(1193, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:25:50'),
(1194, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:25:56'),
(1195, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:25:58'),
(1196, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:26:06'),
(1197, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:26:09'),
(1198, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:26:18'),
(1199, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:26:20'),
(1200, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:26:21'),
(1201, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:26:29'),
(1202, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:26:31'),
(1203, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:26:32'),
(1204, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 297\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:26:36'),
(1205, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:26:37'),
(1206, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:26:38'),
(1207, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 297\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:26:48'),
(1208, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:26:49'),
(1209, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 1\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:26:50'),
(1210, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:26:51'),
(1211, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:26:52'),
(1212, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:26:53'),
(1213, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 393\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:26:54'),
(1214, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:26:56'),
(1215, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-29\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:26:57'),
(1216, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-29\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-29\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-29\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-29\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:26:57'),
(1217, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:26:57'),
(1218, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:26:57'),
(1219, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:26:57'),
(1220, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:26:57'),
(1221, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:26:58');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(1222, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-22\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-22\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-22\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-22\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:26:59'),
(1223, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-22\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-22\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-22\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-22\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:26:59'),
(1224, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:27:00'),
(1225, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:27:00'),
(1226, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:27:00'),
(1227, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:27:00'),
(1228, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:27:01'),
(1229, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:27:51'),
(1230, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:27:51'),
(1231, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:27:52'),
(1232, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:27:52'),
(1233, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:27:52'),
(1234, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:27:53'),
(1235, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:30:07'),
(1236, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:30:29'),
(1237, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:30:33'),
(1238, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:30:35'),
(1239, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:30:38'),
(1240, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:30:38'),
(1241, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:30:38'),
(1242, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:30:38'),
(1243, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:30:38'),
(1244, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:30:39'),
(1245, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:30:40'),
(1246, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:30:40'),
(1247, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:30:40'),
(1248, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:30:40'),
(1249, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:30:41'),
(1250, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:30:41'),
(1251, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:30:50'),
(1252, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:30:51');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(1253, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:30:52'),
(1254, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:30:52'),
(1255, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:30:52'),
(1256, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:30:53'),
(1257, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:31:05'),
(1258, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:31:05'),
(1259, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:31:05'),
(1260, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:31:05'),
(1261, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:31:05'),
(1262, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:31:05'),
(1263, 'main_one_way_getSearchDetailsData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id,FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,\r\nFAS.payment_gatway_charges,FAS.amount,FAS.percentage, USER.company_name,USER.role_id,FARETAX.base_fare,FARETAX.fee_taxes,SINVEN.credit_limit as inventory_credit_limit,\r\nSINVEN.share_price_breakup as inventory_price_breckup,SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,\r\n(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info,FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id,\r\nFGT.departure_city_id,FGT.departure_airport_id,\r\nFGT.dep_terminal_no_id,FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,\r\nFGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name, arrival_airports.airport_code as arrival_airport_code, airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT \r\nINNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id\r\nINNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\nINNER join users as USER on USER.id = FGT.user_id \r\nINNER join flght_api_settings as FAS on FAS.user_id = 1\r\nINNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id\r\nINNER join cities as  departure_city on departure_city.id = FGT.departure_city_id \r\nINNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id\r\nINNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\nINNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id\r\nINNER join airlines as  airlines on airlines.id = FGT.airline_id \r\nWHERE FGT.status = 1\r\nand return_flight=0\r\nand FGT.id=6\r\nand FGT.user_id IN (2,3) \r\nand SINVEN.id IN  (9,10) \r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status=1 \r\nand FPNR.available_seat > 0\r\nand PSA.plan_no = share_plan \r\nand PSA.flight_date = \'2021-07-21\'\r\nand PSA.available_seats > 0 \r\nand FPNR.date =\'2021-07-21\'\r\nand FARETAX.date =\'2021-07-21\' group by FGT.id', '2021-07-16 07:31:54'),
(1264, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:33:05'),
(1265, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:33:05'),
(1266, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 1010\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:33:05'),
(1267, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:33:05'),
(1268, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:33:05'),
(1269, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 1010 \r\nand flights.arrival_city_id = 1740\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:33:06'),
(1270, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:33:25'),
(1271, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:33:29'),
(1272, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:33:30'),
(1273, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:33:31'),
(1274, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:33:43'),
(1275, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:33:43'),
(1276, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-19\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2) \r\n                            and SINVEN.id IN  (9)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-19\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-19\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-19\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:33:47'),
(1277, 'website_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = USER.id\r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-19\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2) \r\n                            and SINVEN.id IN  (9)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-19\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-19\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-19\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:33:47'),
(1278, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:33:47'),
(1279, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:33:47'),
(1280, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:33:47'),
(1281, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:33:48'),
(1282, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:33:48'),
(1283, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:35:44'),
(1284, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:35:44'),
(1285, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:35:44'),
(1286, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:35:45'),
(1287, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:35:45'),
(1288, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:39:29'),
(1289, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:39:29'),
(1290, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:39:30'),
(1291, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:39:30'),
(1292, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:39:31');
INSERT INTO `test` (`id`, `table_key`, `table_value`, `created`) VALUES
(1293, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:39:35'),
(1294, 'main_getDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:39:35'),
(1295, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:39:35'),
(1296, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:39:35'),
(1297, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:39:35'),
(1298, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:39:45'),
(1299, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:39:46'),
(1300, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:39:47'),
(1301, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:39:47'),
(1302, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:39:47'),
(1303, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:39:48'),
(1304, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:39:48'),
(1305, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:39:49'),
(1306, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:39:49'),
(1307, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:39:50'),
(1308, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 1\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:40:02'),
(1309, 'website_websiteGetDepartureCities', 'SELECT SINVEN.id as shared_inventory_plan_Id,flights.id, flights.departure_city_id , flights.departure_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name, airport.airport_code AS airport_code,departure_city.name AS departure_city_name, departure_city.city_code AS departure_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\n INNER JOIN airports AS airport ON  flights.departure_airport_id = airport.id \r\nINNER JOIN cities AS departure_city ON  flights.departure_city_id = departure_city.id \r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id \r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY departure_city_id, departure_airport_id ORDER BY flights.id DESC ', '2021-07-16 07:40:02'),
(1310, 'website_websiteGetArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and SINVEN.share_to_user_id=2 and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:40:03'),
(1311, 'webiste_websiteGetTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:40:03'),
(1312, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:40:06'),
(1313, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:40:07'),
(1314, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:40:08'),
(1315, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:40:08'),
(1316, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:40:08'),
(1317, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:40:09'),
(1318, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:40:09'),
(1319, 'main_oneway_getSearchData', 'SELECT (select distinct role_id from users where id=SINVEN.share_to_user_id) as share_to_user_role_id, FAS.add_margin,FAS.margin,FAS.client_discount,FAS.vendor_discount,USER.company_name, USER.role_id, FARETAX.base_fare, FARETAX.fee_taxes, SINVEN.credit_limit as inventory_credit_limit, SINVEN.share_price_breakup as inventory_price_breckup, SINVEN.share_plan,SINVEN.share_by_user_id,SINVEN.share_to_user_id,FGT.id as flight_id,FGT.user_id,(select option_value from options where user_id=FGT.user_id and option_key=\"special_info\" limit 0,1) as special_info, FGT.re_flight_number,FGT.flight_number,FGT.name,FGT.airline_id, FGT.departure_city_id,FGT.departure_airport_id,FGT.dep_terminal_no_id, FGT.departure_time,FGT.arrival_city_id,FGT.arrival_airport_id,FGT.arrival_terminal_no_id,FGT.arrival_date,FGT.arrival_time,FGT.return_flight,FGT.checkin_baggages_adult,FGT.checkin_baggages_infant,FGT.cabin_baggages_adult,FGT.cabin_baggages_children,FGT.checkin_baggages_children,FGT.cabin_baggages_children,FGT.cabin_baggages_infant,departure_city.country_id as departure_country_id,departure_city.name as departure_city_name,arrival_city.name as arrival_city_name, arrival_city.country_id as arrival_country_id,departure_airports.name as departure_airport_name,departure_airports.airport_code as departure_airport_code,arrival_airports.name as arrival_airport_name ,arrival_airports.airport_code as arrival_airport_code ,airlines.name as airlines_name,airlines.logo as airlines_logo,airlines.airline_no,airlines.airline_code,FPNR.date as ticket_date ,FPNR.return_dep_date as return_dep_date,FPNR.pnr_number as pnr_number,FPNR.infant_price as infant_price,FPNR.block_seat as block_seat,PSA.available_seats as total_available_seats FROM flights as FGT\r\n                            INNER join planwise_seat_availabilities as PSA on PSA.flight_id = FGT.id \r\n                            INNER join flight_pnrs as FPNR on FPNR.flight_id = FGT.id \r\n                            INNER join flight_fare_taxes as FARETAX on FARETAX.flight_id = FGT.id \r\n                            INNER join users as USER on USER.id = FGT.user_id \r\n                            INNER join flght_api_settings as FAS on FAS.user_id = 1 \r\n                            INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = FGT.user_id \r\n                            INNER join cities as  departure_city on departure_city.id = FGT.departure_city_id\r\n                            INNER join cities as  arrival_city on arrival_city.id = FGT.arrival_city_id \r\n                            INNER join airports as  departure_airports on departure_airports.id = FGT.departure_airport_id \r\n                            INNER join airports as  arrival_airports on arrival_airports.id = FGT.arrival_airport_id \r\n                            INNER join airlines as  airlines on airlines.id = FGT.airline_id \r\n                            WHERE FGT.status = 1 \r\n                            and now() <=  ADDTIME(DATE_SUB(\'2021-07-21\',INTERVAL FGT.close_before_days DAY),FGT.close_before_time) \r\n                            and return_flight=0 \r\n                            and departure_city_id = 543\r\n                            and departure_airport_id=1023\r\n                            and  arrival_city_id=1010\r\n                            and arrival_airport_id=2110\r\n                            and FGT.user_id IN (2,3) \r\n                            and SINVEN.id IN  (9,10)  \r\n                            and PSA.plan_no = share_plan\r\n							and PSA.flight_date = \'2021-07-21\' \r\n                            and PSA.available_seats > 0\r\n                            and FPNR.available_seat > 0 \r\n                            and FPNR.date =\'2021-07-21\' \r\n                            and SINVEN.status = 1\r\n                            and SINVEN.accepted_status=1 \r\n                            and FARETAX.date =\'2021-07-21\' \r\n                            group by FPNR.flight_id ORDER by USER.role_id desc', '2021-07-16 07:40:09'),
(1320, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:40:10'),
(1321, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:40:10'),
(1322, 'main_getArrivalCities', 'select SINVEN.id as shared_inventory_plan_Id,flights.id, flights.arrival_city_id , flights.arrival_airport_id , \r\nairport.id AS airport_id, airport.name AS airport_name,airport.airport_code AS airport_code, arrival_city.name AS arrival_city_name, \r\n arrival_city.city_code AS arrival_city_code,SINVEN.share_plan as vendor_share_plan\r\n FROM flights AS flights \r\nINNER JOIN airports AS airport ON  flights.arrival_airport_id = airport.id \r\nINNER JOIN cities AS arrival_city ON  flights.arrival_city_id = arrival_city.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\n INNER join planwise_seat_availabilities as PWSA on PWSA.flight_id = flights.id\r\n WHERE flights.status = 1 \r\n and PWSA.plan_no=SINVEN.share_plan \r\n and (SINVEN.share_to_user_id=2  OR SINVEN.share_to_user_id IN (select GROUP_CONCAT(id) from users where role_id=1)) and  ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now() \r\n /*and SINVEN.id IN  (2,22) */\r\n and  PWSA.available_seats > 0 \r\n AND flights.return_flight = 0\r\n AND flights.departure_city_id = 543\r\n and SINVEN.status = 1 \r\n and SINVEN.accepted_status=1\r\n and flights.user_id IN (2,3) \r\n GROUP BY arrival_city_id, arrival_airport_id ORDER BY flights.id DESC', '2021-07-16 07:40:10'),
(1323, 'main_getTicketAvailableDate', 'select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA \r\nINNER join flights AS flights on PWSA.flight_id = flights.id\r\nINNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id\r\nwhere flights.status = 1  \r\nand flights.departure_city_id = 543 \r\nand flights.arrival_city_id = 1010\r\nand ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()\r\nand PWSA.plan_no=SINVEN.share_plan\r\nand PWSA.available_seats > 0 \r\nAND flights.return_flight = 0\r\nand SINVEN.status = 1\r\nand SINVEN.accepted_status =1 \r\nand flights.user_id IN (2,3) ORDER BY PWSA.flight_date ASC', '2021-07-16 07:40:11');
