public static function replaceTablePrefix($sql, $filter = [])
    {
        $parser = new PHPSQLParser();
        $parsed = $parser->parse($sql, false);

        $tableNames = [];
        if (isset($parsed['FROM'])) {
            foreach ($parsed['FROM'] as $table) {
                if ($table['expr_type'] == 'table') {
                    $tableNames[] = $table['table'];
                }
            }
        }

        $tables = implode('|', $tableNames);
        $sql = preg_replace_callback('#(' . $tables .')#', function($match) {
            if (preg_match('#`(.*?)`#', $match[1], $matchTable)) {
                $match[1] = $matchTable[1];
            }

            return '{{%' . $match[1] . '}}';
        }, $sql);

        var_dump($sql);

        return $sql;
    }