Does reaction quotient Q take into account pure solids and liquids?
It isn't that solids don't appear in equilibrium constants and/or reaction quotients. They are simply assumed to have an activity equal to the value of 1! Hence people don't show them, but they should. I think it is important to understand and remember this assumption.

Also, equilibrium constants and reaction quotients are fundamentally a ratio of activities! The use of concentration and/or pressures in equilibrium constants/ reaction quotients is the results of approximations in themselves and this simplicity permeates chemistry and should be stopped or at least respected.

for the reaction you show, the equilibrium constant is

$$K_\mathrm{eq} = \frac{a_\ce{H2PO4-}a_\ce{H3O+}}{a_\ce{H3PO4}a_\ce{H2O}}$$

See the Chemistry LibreTexts for more details about solid and liquid activities and equilibrium constants.