Update DbSelect.php

Added condition that checks whether joins