its very simple to remember, Generally you will not earn Miles on a Partner of a Member even if its a code-share of another Member
HA is a partner of UA and not a Member of *A, so no credit on CO but you would get UA credit depending possibly on the fare purchased. Thats even if UA is selling it as UA Flight 1112
then if any EQMs are earned is a separate problem, many Partners of a Member earns RDMs but no EQMs or Bonus RDMs