In almost any jurisdiction, the restaurant will pay tax on the amount after the discount.
Discounting is just a selective way to reduce prices for particular clients and thus achieve some degree of price discrimination. It's no different in principle to cutting prices for everyone or having a sale or similar.