The two police officers shot by a Bronx robber they were trying to arrest would have rather not gotten visited by Mayor de Blasio, family and fellow cops told The Post on Tuesday.

The father of the more seriously wounded of the pair, Officer Andrew Dossi, 30, said his son “wasn’t too happy about the mayor’s visit.”

“He deals with some crappy people every day and getting no support — come on,” Joe Dossi said, referring to the feud between the NYPD’s rank and file and de Blasio over unrestrained anti-cop protests and the mayor saying he had cautioned mixed-race son Dante to be wary of cops.

“These are the guys in the trenches dealing with anything and everything,” the proud dad said.

The elder Dossi said he even gave de Blasio a piece of his mind at St. Barnabas Hospital when the mayor stopped by with NYPD Commissioner Bill Bratton following the Monday night shooting.

“I told him these guys are laying their lives on the line,” Joe Dossi said.

But de Blasio did little to lift the shot cop’s spirits, his dad said.

“The mayor seemed passive, like he was just listening to what Bratton was saying and what I was saying,” Joe Dossi said.

The other wounded cop, Aliro Pellerano, 38, told fellow officers to tell de Blasio he just wanted to be with his family, sources said.

Dossi lives with his parents and 8-year-old daughter in Rockland County.

He and his wife are divorcing, sources said, and Dossi’s father said Andrew often carpools to work with Pellerano.

Joe Dossi, 66, said his granddaughter wasn’t immediately told her dad got shot.

He said his son narrowly escaped being paralyzed by a bullet that struck him in the back — and was still lodged inside his body — because it “just missed his spine.”

His left forearm was also shattered in the shooting, and he’s expected to remain hospitalized for at least two weeks.

Dossi joined the US Army 10 years ago and spent 500 days in Iraq during his first tour of duty between 2004 and 2005, and 400 days there between 2007 and 2008.

Dossi, a reservist staff sergeant, was set to redeploy to Africa next week.

“The doctors expect a full recovery. But that arm — I just hope that doesn’t affect his career . . . He can’t jump out of airplanes with a messed-up arm,” his dad said.

Pellerano’s father, Benny, said, “Everybody is doing OK and he is doing OK.”

Pellerano, hit in the chest and left arm, is expected to be released from the hospital Wednesday.

City Hall didn’t respond to a ­request for comment.

Additional reporting by Erin ­Calabrese