Every time I've flown, as long as each flight has a different flight #, you get the mileage for that flight.
Flying PVD-DTW-MEM-STL gets different mile than STL-MSP-PVD, and that get more mileage than a (more direct) PVD-DTW-STL.
Likewise, PVD-ORD-LAX-LAS does not give the same mileage as PVD-DTW-SEA-LAS, PVD-ATL-DFW-LAS, LAS-IAH-EWR-PVD, or the more direct PVD-ORD-LAS.