Homodyne-like detection scheme based on photon-number-resolving detectors