src/Mysqli.php
public function query($sql = '')
    {
        !$sql ?: $this->_sql = $sql;
        $_beginTime          = microtime(true);
        $result              = mysqli_query($this->linkId, $this->_sql);
        $_endTime            = microtime(true);

        $this->sqlInfo['time'] = $_endTime - $_beginTime; //获取执行时间
        $this->sqlInfo['sql']  = $this->_sql;

        if ($result) {
            Trace::addSqlInfo($this->sqlInfo); //存入调试信息中
            $this->addSqlLog(); //存入文件中
            return $result;
        } else {

            //存入文件
            if ($this->dbConfig['db_save_log']) {
                $this->addErrorSqlLog();
            }

            if (config('debug')) {
                throw new Exception('SQL ERROR : ' . $this->_sql);
            }

            if (config('trace')) {
                Trace::addErrorInfo('[SQL ERROR] ' . $this->_sql);
            }

            return false;

        }

    }
public function query($sql = '')
    {
        !$sql ?: $this->_sql = $sql;
        $_beginTime          = microtime(true);
        $result              = mysqli_query($this->linkId, $this->_sql);
        $_endTime            = microtime(true);

        $this->sqlInfo['time'] = $_endTime - $_beginTime; //获取执行时间
        $this->sqlInfo['sql']  = $this->_sql;

        if ($result) {
            Trace::addSqlInfo($this->sqlInfo); //存入调试信息中
            $this->addSqlLog(); //存入文件中
            return $result;
        } else {

            //存入文件
            if ($this->dbConfig['db_save_log']) {
                $this->addErrorSqlLog();
            }

            if (config('debug')) {
                throw new Exception('SQL ERROR : ' . $this->_sql);
            }

            if (config('trace')) {
                Trace::addErrorInfo('[SQL ERROR] ' . $this->_sql);
            }

            return false;

        }

    }
执行
@date   2017-03-19T16:20:36+0800
@author ChenMingjiang
@param  [type]                   $sql [description]
@return [type]                        [description]