Turkey applied to join the EU and it's predecessors since 1987 but an application is not an acceptance. And it will definitely NOT happen while Erdoğan is their head of state.
The EU never declined Ukraine's application, but the process is a very bureaucratic and lengthy one. Ukraines application is on a good way and they will be a full EU member way before that's ever on the table for Turkey.
You might be talking about the NATO. Turkey is a member since 1952. Way before Erdoğans time and while Ukraine was still part of the UDSSR. But again, Ukraine wasn't denied here either. They are well on their way to become a NATO member.