Update QueryBuilder.php

Fixed some errors – syntax with ";" after closure function and also moved building of unions queries into this function.