Think/Model.php
protected function parseSql($sql)
    {
        $sql = strtr($sql, ['__TABLE__' => $this->getTableName(), '__PREFIX__' => $this->tablePrefix]);
        $prefix = $this->tablePrefix;
        $sql = preg_replace_callback(
            "/__([A-Z0-9_-]+)__/sU",
            function ($match) use ($prefix) {
                return $prefix.strtolower($match[1]);
            },
            $sql
        );

        $this->db->setModel($this->name);

        return $sql;
    }
protected function parseSql($sql)
    {
        $sql = strtr($sql, ['__TABLE__' => $this->getTableName(), '__PREFIX__' => $this->tablePrefix]);
        $prefix = $this->tablePrefix;
        $sql = preg_replace_callback(
            "/__([A-Z0-9_-]+)__/sU",
            function ($match) use ($prefix) {
                return $prefix.strtolower($match[1]);
            },
            $sql
        );

        $this->db->setModel($this->name);

        return $sql;
    }
解析SQL语句
@param string $sql SQL指令
@return string