If ticketed MSY-SFO-LAX but getting off at SFO, you will be credited for MSY-SFO but not SFO-LAX. The single flight number has no impact (on UA).
(note if continued to LAX, the credit would be MSY-SFO + SFO-LAX.)
Regardless if there is a plane change in SFO, all passengers will leave the plane at SFO and those continuing will then board the new flight. If passagner does not board the SFO-LAX flight, there will be no credit for that flight.