src/Debug.php
static public function setSql(string $method, string $prepare, float $time, $params = null, string $sql = ''): void
    {
        [$class, $info] = self::info();

        //不记录MLog里的SQL,这里都是日志
        if ($class == 'SLogTable' and $method != 'Connect') {
            return;
        }
        self::set([
            'method' => $method,
            'sql' => $sql,
            'time' => round($time, 2),
            'prepare' => $prepare,
            'params' => $params,
            'trace' => $info
        ], 'sql');
    }
static public function setSql(string $method, string $prepare, float $time, $params = null, string $sql = ''): void
    {
        [$class, $info] = self::info();

        //不记录MLog里的SQL,这里都是日志
        if ($class == 'SLogTable' and $method != 'Connect') {
            return;
        }
        self::set([
            'method' => $method,
            'sql' => $sql,
            'time' => round($time, 2),
            'prepare' => $prepare,
            'params' => $params,
            'trace' => $info
        ], 'sql');
    }
记录一次数据库访问的调试信息

@param string $method 执行方式:Query/Execute/QueryHandle/
@param string $prepare
@param  $time  float 花费的时间(毫秒)
@param $params array|string|null
@param $sql string