当前位置:首页>python>用Python复刻经典!PyQt6打造专属俄罗斯方块游戏(附源码)

用Python复刻经典!PyQt6打造专属俄罗斯方块游戏(附源码)

  • 2026-01-11 08:36:23
用Python复刻经典!PyQt6打造专属俄罗斯方块游戏(附源码)

还记得那个让我们废寝忘食的经典游戏吗?今天,让我们用Python + PyQt6,亲手打造一个属于自己的俄罗斯方块!

首先演示一下整体运行效果

项目亮点

这个项目不仅是一个游戏,更是学习GUI编程的绝佳案例:
纯代码实现- 无需外部图片资源
面向对象设计- 4个核心类,结构清晰
事件驱动编程- 键盘控制、定时器机制
图形绘制技术- 自定义绘图,视觉效果好

核心架构解析

四大核心类,各司其职

1. Tetris类 - 游戏总指挥,负责窗口管理、状态栏显示

class Tetris(QMainWindow):    """主窗口类 - 创建游戏的主界面窗口"""    def __init__(self):        super().__init__()        self.initUI()    def initUI(self):        """初始化应用程序界面"""        self.tboard = Board(self)  # 创建游戏板        self.setCentralWidget(self.tboard)  # 将游戏板设置为中心组件        self.statusbar = self.statusBar()  # 创建状态栏        # 连接信号:当游戏板发送消息时,在状态栏显示        self.tboard.msg2Statusbar[str].connect(self.statusbar.showMessage)        self.tboard.start()  # 开始游戏        self.resize(180380)  # 设置窗口大小        self.center()  # 窗口居中显示        self.setWindowTitle('Tetris')        self.show()    def center(self):        """将窗口居中显示在屏幕上"""        qr = self.frameGeometry()  # 获取窗口的几何信息        cp = self.screen().availableGeometry().center()  # 获取屏幕中心点        qr.moveCenter(cp)  # 将窗口中心移动到屏幕中心        self.move(qr.topLeft())  # 移动窗口到计算的位置

2. Board类 - 游戏逻辑核心

class Board(QFrame):    """游戏板类 - 包含游戏的核心逻辑"""    msg2Statusbar = pyqtSignal(str)  # 信号:用于向状态栏发送消息    BoardWidth = 10   # 游戏板宽度(列数)    BoardHeight = 22  # 游戏板高度(行数)    Speed = 300       # 游戏速度(毫秒)    def __init__(self, parent):        super().__init__(parent)        self.initBoard()    def initBoard(self):        """初始化游戏板"""        self.timer = QBasicTimer()  # 游戏定时器        self.isWaitingAfterLine = False  # 是否在消除行后等待        self.curX = 0  # 当前方块X坐标        self.curY = 0  # 当前方块Y坐标        self.numLinesRemoved = 0  # 已消除的行数        self.board = []  # 游戏板数据(存储已固定的方块)        self.setFocusPolicy(Qt.FocusPolicy.StrongFocus)  # 设置焦点策略,以便接收键盘事件        self.isStarted = False  # 游戏是否已开始        self.isPaused = False   # 游戏是否暂停        self.clearBoard()  # 清空游戏板    def shapeAt(self, x, y):        """获取游戏板上指定位置的方块类型"""        return self.board[(y * Board.BoardWidth) + x]    def setShapeAt(self, x, y, shape):        """在游戏板上设置指定位置的方块类型"""        self.board[(y * Board.BoardWidth) + x] = shape    def squareWidth(self):        """返回单个方块单元的宽度(像素)"""        return self.contentsRect().width() // Board.BoardWidth    def squareHeight(self):        """返回单个方块单元的高度(像素)"""        return self.contentsRect().height() // Board.BoardHeight    def start(self):        """开始游戏"""        if self.isPaused:            return        self.isStarted = True        self.isWaitingAfterLine = False        self.numLinesRemoved = 0  # 重置消除行数        self.clearBoard()  # 清空游戏板        self.msg2Statusbar.emit(str(self.numLinesRemoved))  # 更新状态栏        self.newPiece()  # 生成新方块        self.timer.start(Board.Speed, self)  # 启动定时器    def pause(self):        """暂停/继续游戏"""        if not self.isStarted:            return        self.isPaused = not self.isPaused        if self.isPaused:            self.timer.stop()  # 暂停时停止定时器            self.msg2Statusbar.emit("paused")        else:            self.timer.start(Board.Speed, self)  # 继续时重启定时器            self.msg2Statusbar.emit(str(self.numLinesRemoved))        self.update()    def paintEvent(self, event):        """绘制游戏中的所有方块"""        painter = QPainter(self)        rect = self.contentsRect()        # 计算游戏板顶部位置        boardTop = rect.bottom() - Board.BoardHeight * self.squareHeight()        # 绘制已固定在游戏板上的方块        for i in range(Board.BoardHeight):            for j in range(Board.BoardWidth):                shape = self.shapeAt(j, Board.BoardHeight - i - 1)                if shape != Tetrominoe.NoShape:                    self.drawSquare(painter,                                    rect.left() + j * self.squareWidth(),                                    boardTop + i * self.squareHeight(), shape)        # 绘制当前正在下落的方块        if self.curPiece.shape() != Tetrominoe.NoShape:            for i in range(4):  # 每个方块由4个小块组成                x = self.curX + self.curPiece.x(i)                y = self.curY - self.curPiece.y(i)                self.drawSquare(painter, rect.left() + x * self.squareWidth(),                                boardTop + (Board.BoardHeight - y - 1) * self.squareHeight(),                                self.curPiece.shape())    def keyPressEvent(self, event):        """处理键盘按键事件"""        if not self.isStarted or self.curPiece.shape() == Tetrominoe.NoShape:            super(Board, self).keyPressEvent(event)            return        key = event.key()        if key == Qt.Key.Key_P:  # P键:暂停/继续            self.pause()            return        if self.isPaused:            return        elif key == Qt.Key.Key_Left.value:  # 左箭头:向左移动            self.tryMove(self.curPiece, self.curX - 1self.curY)        elif key == Qt.Key.Key_Right.value:  # 右箭头:向右移动            self.tryMove(self.curPiece, self.curX + 1self.curY)        elif key == Qt.Key.Key_Down.value:  # 下箭头:向右旋转            self.tryMove(self.curPiece.rotateRight(), self.curX, self.curY)        elif key == Qt.Key.Key_Up.value:  # 上箭头:向左旋转            self.tryMove(self.curPiece.rotateLeft(), self.curX, self.curY)        elif key == Qt.Key.Key_Space.value:  # 空格键:快速下落到底部            self.dropDown()        elif key == Qt.Key.Key_D.value:  # D键:向下移动一行            self.oneLineDown()        else:            super(Board, self).keyPressEvent(event)    def timerEvent(self, event):        """处理定时器事件 - 自动让方块下落"""        if event.timerId() == self.timer.timerId():            if self.isWaitingAfterLine:  # 如果刚消除了行,生成新方块                self.isWaitingAfterLine = False                self.newPiece()            else:  # 否则让方块下落一行                self.oneLineDown()        else:            super(Board, self).timerEvent(event)    def clearBoard(self):        """清空游戏板 - 将所有位置设置为空"""        for i in range(Board.BoardHeight * Board.BoardWidth):            self.board.append(Tetrominoe.NoShape)    def dropDown(self):        """快速下落方块到底部"""        newY = self.curY        while newY > 0:            # 尝试向下移动,直到无法移动为止            if not self.tryMove(self.curPiece, self.curX, newY - 1):                break            newY -= 1        self.pieceDropped()  # 固定方块并处理消除行    def oneLineDown(self):        """让方块向下移动一行"""        if not self.tryMove(self.curPiece, self.curX, self.curY - 1):            self.pieceDropped()  # 如果无法下移,固定方块    def pieceDropped(self):        """方块固定后,移除满行并生成新方块"""        # 将当前方块的4个小块固定到游戏板上        for i in range(4):            x = self.curX + self.curPiece.x(i)            y = self.curY - self.curPiece.y(i)            self.setShapeAt(x, y, self.curPiece.shape())        self.removeFullLines()  # 移除满行        if not self.isWaitingAfterLine:            self.newPiece()  # 生成新方块    def removeFullLines(self):        """移除游戏板上的所有满行"""        numFullLines = 0        rowsToRemove = []  # 需要移除的行索引列表        # 检查每一行是否已满        for i in range(Board.BoardHeight):            n = 0  # 该行中非空格子的数量            for j in range(Board.BoardWidth):                if not self.shapeAt(j, i) == Tetrominoe.NoShape:                    n = n + 1            if n == 10:  # 如果一行全满(10列)                rowsToRemove.append(i)        rowsToRemove.reverse()  # 从下往上移除,避免索引问题        # 移除满行:将上方的行向下移动        for m in rowsToRemove:            for k in range(m, Board.BoardHeight):                for l in range(Board.BoardWidth):                    self.setShapeAt(l, k, self.shapeAt(l, k + 1))        numFullLines = numFullLines + len(rowsToRemove)        if numFullLines > 0:            self.numLinesRemoved = self.numLinesRemoved + numFullLines  # 更新消除行数            self.msg2Statusbar.emit(str(self.numLinesRemoved))  # 更新状态栏显示            self.isWaitingAfterLine = True  # 标记等待状态            self.curPiece.setShape(Tetrominoe.NoShape)  # 清除当前方块            self.update()  # 刷新显示    def newPiece(self):        """创建新的方块"""        self.curPiece = Shape()  # 创建新方块对象        self.curPiece.setRandomShape()  # 随机设置方块形状        # 设置初始位置:水平居中,顶部对齐        self.curX = Board.BoardWidth // 2 + 1        self.curY = Board.BoardHeight - 1 + self.curPiece.minY()        # 尝试放置新方块,如果无法放置则游戏结束        if not self.tryMove(self.curPiece, self.curX, self.curY):            self.curPiece.setShape(Tetrominoe.NoShape)            self.timer.stop()  # 停止定时器            self.isStarted = False            self.msg2Statusbar.emit("Game over")  # 显示游戏结束    def tryMove(self, newPiece, newX, newY):        """尝试移动方块到新位置 - 返回True表示可以移动,False表示不能移动"""        # 检查方块的4个小块是否都在有效范围内        for i in range(4):            x = newX + newPiece.x(i)            y = newY - newPiece.y(i)            # 检查是否超出边界            if x < 0 or x >= Board.BoardWidth or y < 0 or y >= Board.BoardHeight:                return False            # 检查该位置是否已被占用            if self.shapeAt(x, y) != Tetrominoe.NoShape:                return False        # 如果所有检查都通过,更新方块位置        self.curPiece = newPiece        self.curX = newX        self.curY = newY        self.update()  # 刷新显示        return True    def drawSquare(self, painter, x, y, shape):        """绘制一个方块单元 - 使用3D效果(高光+阴影)"""        # 颜色表:每种方块类型对应一种颜色        colorTable = [0x0000000xCC66660x66CC660x6666CC,                      0xCCCC660xCC66CC0x66CCCC0xDAAA00]        color = QColor(colorTable[shape])        # 绘制方块的主体部分        painter.fillRect(x + 1, y + 1self.squareWidth() - 2,                         self.squareHeight() - 2, color)        # 绘制高光效果(左上边缘)        painter.setPen(color.lighter())        painter.drawLine(x, y + self.squareHeight() - 1, x, y)        painter.drawLine(x, y, x + self.squareWidth() - 1, y)        # 绘制阴影效果(右下边缘)        painter.setPen(color.darker())        painter.drawLine(x + 1, y + self.squareHeight() - 1,                         x + self.squareWidth() - 1, y + self.squareHeight() - 1)        painter.drawLine(x + self.squareWidth() - 1,                         y + self.squareHeight() - 1, x + self.squareWidth() - 1, y + 1)
3. Tetrominoe类 - 方块类型定义
class Tetrominoe:    """俄罗斯方块类型枚举类 - 定义7种标准方块形状"""    NoShape = 0        # 空形状    ZShape = 1         # Z形方块    SShape = 2         # S形方块    LineShape = 3      # 直线形方块    TShape = 4         # T形方块    SquareShape = 5    # 方形方块    LShape = 6         # L形方块    MirroredLShape = 7 # 镜像L形方块
4. Shape类 - 方块操作专家
class Shape:    """方块形状类 - 定义方块的坐标和旋转方法"""    # 坐标表:每种方块类型的4个小块相对于中心点的坐标 (x, y)    coordsTable = (        ((00), (00), (00), (00)),        # 空形状        ((0, -1), (00), (-10), (-11)),     # Z形        ((0, -1), (00), (10), (11)),       # S形        ((0, -1), (00), (01), (02)),       # 直线形        ((-10), (00), (10), (01)),       # T形        ((00), (10), (01), (11)),        # 方形        ((-1, -1), (0, -1), (00), (01)),     # L形        ((1, -1), (0, -1), (00), (01))       # 镜像L形    )    def __init__(self):        """初始化方块 - 每个方块由4个小块组成"""        self.coords = [[00for i in range(4)]  # 4个小块的坐标        self.pieceShape = Tetrominoe.NoShape  # 方块类型        self.setShape(Tetrominoe.NoShape)    def shape(self):        """返回方块类型"""        return self.pieceShape    def setShape(self, shape):        """设置方块形状 - 从坐标表中加载对应形状的坐标"""        table = Shape.coordsTable[shape]        for i in range(4):            for j in range(2):                self.coords[i][j] = table[i][j]  # 复制坐标数据        self.pieceShape = shape    def setRandomShape(self):        """随机选择一个方块形状(1-7)"""        self.setShape(random.randint(17))    def x(self, index):        """返回指定小块的X坐标"""        return self.coords[index][0]    def y(self, index):        """返回指定小块的Y坐标"""        return self.coords[index][1]    def setX(self, index, x):        """设置指定小块的X坐标"""        self.coords[index][0] = x    def setY(self, index, y):        """设置指定小块的Y坐标"""        self.coords[index][1] = y    def minX(self):        """返回所有小块中的最小X值"""        m = self.coords[0][0]        for i in range(4):            m = min(m, self.coords[i][0])        return m    def maxX(self):        """返回所有小块中的最大X值"""        m = self.coords[0][0]        for i in range(4):            m = max(m, self.coords[i][0])        return m    def minY(self):        """返回所有小块中的最小Y值"""        m = self.coords[0][1]        for i in range(4):            m = min(m, self.coords[i][1])        return m    def maxY(self):        """返回所有小块中的最大Y值"""        m = self.coords[0][1]        for i in range(4):            m = max(m, self.coords[i][1])        return m    def rotateLeft(self):        """向左旋转方块(逆时针90度)"""        if self.pieceShape == Tetrominoe.SquareShape:  # 方形不需要旋转            return self        result = Shape()        result.pieceShape = self.pieceShape        # 旋转矩阵:逆时针90度 (x, y) -> (y, -x)        for i in range(4):            result.setX(i, self.y(i))            result.setY(i, -self.x(i))        return result    def rotateRight(self):        """向右旋转方块(顺时针90度)"""        if self.pieceShape == Tetrominoe.SquareShape:  # 方形不需要旋转            return self        result = Shape()        result.pieceShape = self.pieceShape        # 旋转矩阵:顺时针90度 (x, y) -> (-y, x)        for i in range(4):            result.setX(i, -self.y(i))            result.setY(i, self.x(i))        return result

 关键技术解析

1️⃣ 游戏循环机制,使用QBasicTime

# 使用QBasicTimer创建稳定游戏循环self.timer = QBasicTimer()self.timer.start(Board.Speed, self)

2️⃣ 数学建模思想

# 用一维数组表示二维游戏板# 巧妙的索引计算:y * BoardWidth + xdef shapeAt(self, x, y):    return self.board[(y * Board.BoardWidth) + x]

3️⃣ 方块旋转算法

def rotateLeft(self):    # 90度逆时针旋转的数学实现    # (x, y) -> (y, -x)    result.setX(i, self.y(i))    result.setY(i, -self.x(i))

4️⃣ 碰撞检测逻辑

def tryMove(self, newPiece, newX, newY):    # 边界检测 + 冲突检测    # 确保方块不会重叠或越界

 按键操作说明

← →左右移动

逆时针旋转

顺时针旋转

空格瞬间掉落

D键加速下降

P键暂停/继续

需要源码的小伙伴可以直接在公众号回复【俄罗斯方块】获取源码下载链接

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-09 05:43:39 HTTP/2.0 GET : https://f.mffb.com.cn/a/459852.html
  2. 运行时间 : 0.098735s [ 吞吐率:10.13req/s ] 内存消耗:5,040.22kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=c9c462b56fdbda6d5551fea4ba0a49e6
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000595s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000848s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000789s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000262s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000521s ]
  6. SELECT * FROM `set` [ RunTime:0.000239s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000578s ]
  8. SELECT * FROM `article` WHERE `id` = 459852 LIMIT 1 [ RunTime:0.000645s ]
  9. UPDATE `article` SET `lasttime` = 1770587019 WHERE `id` = 459852 [ RunTime:0.010521s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000303s ]
  11. SELECT * FROM `article` WHERE `id` < 459852 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000553s ]
  12. SELECT * FROM `article` WHERE `id` > 459852 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000415s ]
  13. SELECT * FROM `article` WHERE `id` < 459852 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.008325s ]
  14. SELECT * FROM `article` WHERE `id` < 459852 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000850s ]
  15. SELECT * FROM `article` WHERE `id` < 459852 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001297s ]
0.100402s