Only the second one seems grammatically correct to me. It is the normal/grammatical word order for reported speech. Yet, with "punctuation" changes, you can hear the first one.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.