Leaving your phone number as your tip on a bar tab is wrong. It's also pretty dumb. Flirtation 101, do not be an asshole.
And this is why I suggest you become a regular at your local bar. You'll know the relationship status of the bartender (he's not single) and you'll get to hear all about the rude customers.
Today I'm going to see if I can pay for my lunch with my phone number. I'll let you know how that goes.