Getting (or not getting) miles has nothing to do with OTAs.
In fact unless the fare is significantly cheaper through the OTA or I was doing a complex routing involving multiple airlines I’d avoid OTAs because of 2 reasons - huge change/cancellation fees & restrictions over and above what the airlines charge and I’d be lower in the pecking order in case of IRROPS unless I had status.