Think about the Phillies during their recent glory years. They won the World Series in 2008 and followed up the championship with a 257-game sellout streak from 2009 to 2012. Fans packed into Citizens Bank Park, filled trains on the Broad Street Line and piled into area bars like McFadden’s and Xfinity Live.

Now think about their forgettable games from the 2014 season. The bleachers and trains were half-full, and seats at the bar were easy to snag. Then multiply all that by the 41 times the tanking Sixers commit a crime against good basketball during their home games this season, and you’ve got a legitimate economic problem.

To be exact, the bumbling struggles of the Phillies and the Sixers will cost the city and state $7 million that they would have otherwise earned in a year, and other businesses that benefit from attendance at their games are missing out on revenues of up to six figures while employing fewer people.

The financial hit arises from various aspects of these dreadful baseball and basketball games: The city is losing on taxes from tickets, concessions, parking and overall annual profits. Ticket brokers are hemorrhaging money with tickets selling for way under face value. SEPTA is missing thousands of riders who would normally take public transit to the stadiums. Employees are working fewer hours or not at all.

In short, Philadelphia is in the midst of a loser’s economy, and it has the Sixers and the Phillies to thank.

Bad teams=bad attendance=less tax revenue

While the Eagles and Flyers have attracted about the same number of fans the last several years despite varying levels of success, that hasn’t been the case with the Phillies or Sixers. Last summer, the Phillies went 73-89 for the second consecutive year. The average attendance at home games was 29,924 per game or about 2,423,844 the whole year. Soaking in the World Series winning high of 2008, the Phillies were averaging sellout crowds of 43,911 from 2008 to 2010, for an average of 3,556,791 fans per year.

The Sixers have been more awful record-wise and about as poor attendance-wise the last two years. This season, as of last week, the team’s average home game attendance has been 14,082 fans. When the Sixers were making the playoffs with Allen Iverson and even competing for the NBA Finals from 2001 to 2004, they averaged 19,779 fans a game.

Less attendance means fewer people parking, fewer people buying food or t-shirts at games and less overall revenue. All of those things affect the city’s tax earnings.

For this project, I compared the Phillies’ 2014 season to the average attendance total from 2008-2010. I compared the Sixers’ 2014 season so far — estimating the number for a full season — to the average attendance total from 2001-2004. Taking into account attendance, parking, in-game sales and overall revenue, the city missed out on just over $7 million worth of taxes it would have made if these teams had constructed a decent basketball or baseball team. That’s 36 percent less than the good years. Here’s how it breaks down.

Lost money from ticket sales: $2.6 million

The city collects a 5 percent tax for every Philadelphia sporting event ticket via the “amusement tax.” Compared to the average of those good years, the Sixers are on pace to see 233,577 fewer fans this year. The Phillies hosted 1,132,947 fewer fans. Using the average price for 2014 Phillies’ tickets ($37.42) and the average price for Sixers tickets ($39.25 !?!?), the money the city isn’t getting that it would get if the teams could actually win a game comes out to nearly $2.6 million.

Lost money from in-game merchandise/concession sales: $1.3 million

According to a 2003 study, the average Major League Baseball fan spends $10-12 on food or memorabilia at a game. At NBA games, the average is $8-10. I went with the higher figure for each because of inflation and calculated that given the lower attendances the Sixers and Phillies are making about $16 million less in this category compared to the good times. The sales tax in Philadelphia for those purchases is 8 percent — 6 percent for the state and two percent for the city. That comes out to $1.3 million less for the city and state because the Sixers and Phillies are bad at sports.

Lost money from parking: $1.3 million

Good Lord, parking is expensive. It costs more to park at Sixers games ($15) than it does to watch the game if you get your ticket on StubHub. The good news is the city makes money off the parking, 20 percent per car. How many cars park at these games? The Wells Fargo Center’s lot features 6,100 spaces. The number of spots at Citizens Bank Park wasn’t available, and no Phillies officials responded to a request for the number. So I estimated it by multiplying the Wells Fargo Center lot’s spaces by 2.15 because Citizens Bank Park is 2.15 times size of the Wells Fargo Center. That number comes out to 13,115.

Assuming that a full house equals a full parking lot, I calculated the percentage capacity of the good years average and 2014 for each team. The Phillies, who charge $16 per car, were averaging better than a sellout during the good years average so the parking lot would have been full each game. Last year they would have been averaging 8,931. The Sixers would have parked 5,935 cars during the good years and would be on pace to park 4,227 each game this year. Multiply the difference between those numbers by the cost of parking for each and the number of homes game per season and then take the 20 percent cut for Philadelphia, and the difference between good and now is $1.3 million. Whew!

Lost money from overall net income: $1.9 million

Another city tax affecting the Sixers and Phillies is the BIRT (Business Income and Receipts Tax). If an eligible company makes a year-end profit, that profit is taxed by 6.45 percent. According to Forbes, the recent awful and expensive version of the Phillies isn’t making money. They lost $20.9 million according to valuations from last year. The Sixers, with a payroll so low they might have to pay a fine because of it, made $24.4 million, according to valuations from this month. But if they were to be good and attracting the same amount of fans as the good years average, the Sixers would make $9.1 million more and the Phillies $41.1 million more on attendance revenues alone. Their current net income would turn into a $33.5 million profit for the Sixers and $20.2 million profit for the Phillies. The city would be making an extra $1.9 million off them.

What $7 million means

Those numbers don’t even take into account deep playoff or championship runs. They could be worth tens of millions for the city and local businesses. But the city has a vast, diverse economy. For fiscal year 2015, it anticipates $2.7 billion in tax revenue. Besides, says Joel Maxcy, a Drexel professor and president of the International Association of Sports Economists, sporting events represent discretionary spending for consumers. If the teams suck, consumers will spend their money elsewhere in Philadelphia, and the city would still get some tax revenue. The problem would be if people are taking the money they’d spend at a Phillies game to somewhere else, like the beach in New Jersey or Delaware.

“Then the Shore benefits from Philadelphia’s loss,” he says.

Of course, $7 million is still $7 million. It’s a ton of money. Philadelphia has so many problems that could be addressed with $7 million. Here’s one way the city could spend the extra funds this year if it had them:

Hire 66 teachers at the Step 5 yearly salary of $57,450 ($3.8 million)

Buy all 142,000 Philly School District students two notebooks ($900K)

Increase Mural Arts’ $1.6 million annual budget by 50 percent ($800K)

Triple annual contributions to the African American History Museum ($700K)

Book Rihanna for a free concert for all Philadelphians ($750K)

Pay retirement fees for all 11 Philadelphia police horses so they can enjoy this nice Virginia farm and UberX drivers can relax ($46,200)

“Everybody hurts”

The other losers from the Sixers’ and Phillies’ failings are the people and organizations doing business around their sporting events, SEPTA being one of them. According to SEPTA, 900 fewer riders (2,600 compared to 3,500) were taking the train out to the stadiums on Philly game days in fiscal year 2014, which encompassed the last half of the losing 2013 season and the first half of the hopeless 2014 season, than the previous fiscal year. The Sixers have been seeing about 200 fewer riders per game the last two seasons compared to recent previous years. This drop of 1,100 riders per game multiplied over the season totals to just under $300,000. And it’s likely for the Phillies that the drop from the glory years of 2008-2010 to the most recent fiscal year is even steeper.

On StubHub, most tickets for Sixers games are half of face value, from the nosebleeds down to the courtside seats. Maxcy says the sellers at sites like StubHub are professional ticket brokers, season ticket holders who don’t plan on attending every game and amateur speculators, all of whom are losing money they would otherwise be making.

At the Wells Fargo Center, a longtime concession stand worker told Billy Penn employees with less seniority were being forced to work fewer hours at Sixers games “and that hurts a lot.” Steven Cedrone and Gretchen Horrisberger work at the P.J. Whelihan’s in the Wells Fargo Center and say the bar used to have three or four more employees working at a time than it does now.

The nearby bars and restaurants aren’t doing any better. Janna Piehuta manages McFadden’s, located next to Citizen’s Bank Park, and remembers the lucrative chaos of the Phillies’ best seasons from 2008 to 2010. Back then there would be a line to get in.

“If they’re not coming to the games, they’re definitely not coming here,” she says. “And there’s really no hype for them this coming summer, so.”

Piehuta says in 2008 and 2009 for Phillies games, McFadden’s would have 14 or 15 bartenders working at a time. They usually had six last season. Rather than crowds going out the door, she describes the atmosphere for Phillies games as comfortably full. Anyone can come in and get a drink or dinner without any stress.

Piehuta went through a list of groups she assumes are struggling because of the Phillies and Sixers: SEPTA, concession food providers like Aramark, ushers, ticket brokers.

“Down to the t-shirt vendors selling illegal Phillies shirts,” she says, “everybody hurts.”

Even the children. Two hours before the Sixers took on the Knicks Wednesday night in a game that featured two of the worst basketball teams assembled in modern history (The Sixers, of course, would lose), some girls were selling Girl Scout cookies at the SEPTA station outside the arena, probably expecting a windfall. I bought a package of peanut butter patties. Knowing they were posted up outside a Sixers game, I figured they would need all the business they could get.