select  distinct PWSA.flight_date from planwise_seat_availabilities as PWSA 
INNER join flights AS flights on PWSA.flight_id = flights.id
INNER join share_inventories as SINVEN on SINVEN.share_by_user_id = flights.user_id
where flights.status = 1  
and flights.departure_city_id = 1010 
and flights.arrival_city_id = 1740
and ADDTIME(DATE_SUB(PWSA.flight_date,INTERVAL flights.close_before_days DAY),flights.close_before_time) >=  now()
and PWSA.plan_no=SINVEN.share_plan
and PWSA.available_seats > 0 
AND flights.return_flight = 0
and SINVEN.status = 1
and SINVEN.accepted_status =1 
and flights.user_id IN (3,2) ORDER BY PWSA.flight_date ASC