It's a humorous and informal way to describe someone who is intoxicated, likely to the point of being unsteady or blurry-eyed. The origin of the phrase is debated, but it's likely related to the glazed or "pie-eyed" look people get when they've had too much to drink.