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
 INNER join flight_ticket_prices as FTP on FTP.flight_id = flights.id                          
where flights.status = 1  
and flights.departure_city_id = 1010 
and flights.arrival_city_id = 2148
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 = 1
and SINVEN.status = 1
and SINVEN.accepted_status =1 
and  FTP.booked_status = 0
and PWSA.flight_date = FTP.ticket_date             
and flights.user_id IN (1,25,26)
and SINVEN.id IN  (5,6,7)  ORDER BY PWSA.flight_date ASC