protected function parseAliases(Builder $query)
    {
        $aliases = [];

        if (!empty($query->getQuery()->columns)) {
            $aliases = $this->getAliases($query);
        }

        if (!empty($aliases) && !empty($query->getQuery()->wheres)) {
            $this->replaceAliases($query, $aliases);
        }

        return $query;
    }