No, it doesn't say that. It says Jesus was incorrectly thought to be the son of Joseph and that Joseph was the son of Heli.
Actually, it doesn't say 'Joseph the son of Heli', but '...Joseph, of Heli'. Jesus, not Joseph, is the subject of the entire sentence ending at v.38 (thus: "Jesus himself... being son, so it was thought, of Joseph, of Heli...").
So my point still stands: if you read it as 'Joseph the son of Heli' then there is no logical consistency to the passage, because it implies that Jesus was also thought to be, but not really, the son of Zerubbabel, David and Abraham (not to mention Adam and God).
The reason Luke doesn't mention Mary is that genealogies were always patrilineal, from father to son, and Luke has already explained Mary's involvement at length.
I am not saying this is
the explanation but that it is a credible one. Other possible explanations include that it is Joseph's biological line (notwithstanding the abovementioned logical inconsistency) and that there was levirate marriage at the points where it differs from Matthew's.