当前位置:首页>python>Python PDF 自动化保姆级⑤:用代码自动生成业务报告,表格图表全搞定

Python PDF 自动化保姆级⑤:用代码自动生成业务报告,表格图表全搞定

  • 2026-08-31 21:53:52
Python PDF 自动化保姆级⑤:用代码自动生成业务报告,表格图表全搞定

前面四篇都是 "处理已有的 PDF",今天换个方向:从零生成 PDF

职场中最痛苦的事情之一,就是每个月 / 每周写业务报告。数据从 Excel 里复制出来,粘贴到 Word,调整格式,插入图表,导出 PDF…… 一套流程下来两小时没了,而且每个月都要重复。

如果用 Python 自动生成呢?数据读取→表格生成→图表绘制→排版导出,全流程自动化。每月跑一次脚本,报告自动生成,你只需要检查一下就能发。

01 reportlab 是什么

reportlab 是 Python 最强大的 PDF 生成库,没有之一。它能做的事情包括:

  • 添加文字、段落、标题(支持中文)
  • 绘制表格(支持合并单元格、自定义样式)
  • 插入图片(PNG/JPG 等)
  • 绘制图表(柱状图、折线图、饼图等)
  • 页面布局(页眉页脚、分页、多栏)

安装:

pip install reportlab
reportlab 有两种使用方式:

低层 API(Canvas):像画笔一样在 PDF 页面上精确绘制每个元素,灵活但繁琐,适合精确排版。

高层 API(Platypus):用 "流式布局" 的方式,把段落、表格、图片作为 "元素" 依次放入文档,自动分页和排版,适合生成报告。

本文主要用 Platypus 高层 API,生成业务报告更高效。

02 第一个 PDF:Hello World

from reportlab.lib.pagesizes import A4from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacerfrom reportlab.lib.styles import getSampleStyleSheetfrom reportlab.lib.units import cm# 创建文档doc = SimpleDocTemplate("hello.pdf", pagesize=A4)# 获取样式styles = getSampleStyleSheet()# 构建内容列表story = []# 添加标题story.append(Paragraph("2024年Q3业务报告", styles["Title"]))story.append(Spacer(10.5 * cm))# 添加正文段落story.append(Paragraph("本报告汇总了2024年第三季度的核心业务数据,包括销售业绩、客户增长和运营效率等关键指标。", styles["Normal"]))story.append(Spacer(10.3 * cm))story.append(Paragraph("报告数据来源于公司CRM系统和财务系统,统计周期为2024年7月1日至9月30日。", styles["Normal"]))# 生成PDFdoc.build(story)print("PDF生成成功: hello.pdf")

核心概念:

  1. SimpleDocTemplate:文档模板,负责页面设置和整体布局。
  2. story:内容列表,按顺序存放所有元素(段落、表格、图片等),最后用 doc.build(story) 一次性生成。
  3. Paragraph:段落元素,支持 HTML 标签(如 <b>加粗</b><i>斜体</i>)。
  4. Spacer:空白间隔,用于控制元素间距。
  5. styles:样式集合,reportlab 自带了 Title、Heading1、Normal 等预设样式。

03 中文支持:注册中文字体

reportlab 默认不支持中文,直接写中文会显示为方框。需要注册中文字体:

from reportlab.lib.pagesizes import A4from reportlab.platypus import SimpleDocTemplate, Paragraphfrom reportlab.lib.styles import getSampleStyleSheet, ParagraphStylefrom reportlab.pdfbase import pdfmetricsfrom reportlab.pdfbase.ttfonts import TTFont# 注册中文字体(Windows示例)pdfmetrics.registerFont(TTFont("SimSun""C:/Windows/Fonts/simsun.ttc"))pdfmetrics.registerFont(TTFont("SimHei""C:/Windows/Fonts/simhei.ttf"))# 创建自定义样式styles = getSampleStyleSheet()title_style = ParagraphStyle(    "ChineseTitle",    parent=styles["Title"],    fontName="SimHei",    fontSize=20,    leading=28,    alignment=1,  # 居中)body_style = ParagraphStyle(    "ChineseBody",    parent=styles["Normal"],    fontName="SimSun",    fontSize=11,    leading=18,    firstLineIndent=22,  # 首行缩进)# 使用doc = SimpleDocTemplate("chinese.pdf", pagesize=A4)story = [    Paragraph("2024年第三季度业务报告", title_style),    Paragraph("本报告汇总了2024年第三季度的核心业务数据……", body_style),]doc.build(story)print("中文PDF生成成功")

各系统字体路径:

  • Windows:C:/Windows/Fonts/simsun.ttc(宋体)、simhei.ttf(黑体)
  • macOS:/System/Library/Fonts/PingFang.ttc(苹方)
  • Linux:/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc(文泉驿,需先安装)

04 绘制表格

表格是业务报告的核心元素。reportlab 的 Table 功能非常强大:

from reportlab.lib.pagesizes import A4from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacerfrom reportlab.lib.styles import getSampleStyleSheet, ParagraphStylefrom reportlab.lib import colorsfrom reportlab.lib.units import cmfrom reportlab.pdfbase import pdfmetricsfrom reportlab.pdfbase.ttfonts import TTFont# 注册字体(同上,省略)pdfmetrics.registerFont(TTFont("SimHei""C:/Windows/Fonts/simhei.ttf"))pdfmetrics.registerFont(TTFont("SimSun""C:/Windows/Fonts/simsun.ttc"))styles = getSampleStyleSheet()cell_style = ParagraphStyle("Cell", fontName="SimSun", fontSize=10, leading=14, alignment=1)header_style = ParagraphStyle("Header", fontName="SimHei", fontSize=10, leading=14, alignment=1, textColor=colors.white)# 表格数据data = [    [Paragraph("指标", header_style), Paragraph("Q1", header_style), Paragraph("Q2", header_style), Paragraph("Q3", header_style), Paragraph("环比", header_style)],    [Paragraph("销售额(万元)", cell_style), Paragraph("1,250", cell_style), Paragraph("1,480", cell_style), Paragraph("1,720", cell_style), Paragraph("+16.2%", cell_style)],    [Paragraph("客户数", cell_style), Paragraph("320", cell_style), Paragraph("385", cell_style), Paragraph("452", cell_style), Paragraph("+17.4%", cell_style)],    [Paragraph("客单价(元)", cell_style), Paragraph("390", cell_style), Paragraph("384", cell_style), Paragraph("380", cell_style), Paragraph("-1.0%", cell_style)],    [Paragraph("复购率", cell_style), Paragraph("28%", cell_style), Paragraph("31%", cell_style), Paragraph("35%", cell_style), Paragraph("+4pp", cell_style)],]# 创建表格table = Table(data, colWidths=[4*cm, 2.5*cm, 2.5*cm, 2.5*cm, 2.5*cm])# 设置样式table.setStyle(TableStyle([    # 表头背景色    ("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#2E5BFF")),    # 表格边框    ("GRID", (0, 0), (-1, -1), 0.5, colors.grey),    # 交替行背景色    ("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.white, colors.HexColor("#F5F7FA")]),    # 内边距    ("TOPPADDING", (0, 0), (-1, -1), 8),    ("BOTTOMPADDING", (0, 0), (-1, -1), 8),    # 垂直居中    ("VALIGN", (0, 0), (-1, -1), "MIDDLE"),]))# 生成PDFdoc = SimpleDocTemplate("table_report.pdf", pagesize=A4)story = [    Paragraph("核心指标汇总", ParagraphStyle("H", fontName="SimHei", fontSize=14, leading=20)),    Spacer(1, 0.5*cm),    table,]doc.build(story)print("表格PDF生成成功")

TableStyle 常用参数:

  • BACKGROUND
    :背景色,参数为 (起始列,起始行,结束列,结束行,颜色)
  • GRID
    :网格线,参数为 (范围,线宽,颜色)
  • ROWBACKGROUNDS
    :交替行背景色
  • SPAN
    :合并单元格,如 ("SPAN", (0,0), (1,0)) 合并前两列的第一行
  • FONTNAME
    FONTSIZE:字体和字号
  • ALIGN
    VALIGN:水平 / 垂直对齐

05 插入图表

推荐方案:用 matplotlib 生成图表再插入 PDF

reportlab 自带的图表功能有限,样式不够美观。更实用的方案是用 matplotlib 生成精美的图表,保存为图片,再插入 PDF:

import matplotlib.pyplot as pltimport matplotlibmatplotlib.rcParams["font.sans-serif"] = ["SimHei"]matplotlib.rcParams["axes.unicode_minus"] = False# 生成柱状图quarters = ["Q1""Q2""Q3""Q4"]sales = [1250, 1480, 1720, 1890]plt.figure(figsize=(8, 4))plt.bar(quarters, sales, color="#2E5BFF")plt.title("季度销售额趋势", fontsize=14)plt.ylabel("销售额(万元)")plt.grid(axis="y", alpha=0.3)plt.tight_layout()plt.savefig("sales_chart.png", dpi=150)plt.close()# 插入PDFfrom reportlab.platypus import Imagefrom reportlab.lib.units import cmimg = Image("sales_chart.png", width=14*cm, height=7*cm)story.append(img)

这个方案的优势是 matplotlib 的图表样式更丰富、更美观,而且你可以完全控制图表的每一个细节。

06 完整业务报告生成示例

现在把上面的知识点整合起来,生成一份完整的业务报告:

from reportlab.lib.pagesizes import A4from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, Image, PageBreakfrom reportlab.lib.styles import ParagraphStylefrom reportlab.lib import colorsfrom reportlab.lib.units import cmfrom reportlab.pdfbase import pdfmetricsfrom reportlab.pdfbase.ttfonts import TTFont# 注册字体pdfmetrics.registerFont(TTFont("SimHei""C:/Windows/Fonts/simhei.ttf"))pdfmetrics.registerFont(TTFont("SimSun""C:/Windows/Fonts/simsun.ttc"))# 样式定义title_style = ParagraphStyle("Title", fontName="SimHei", fontSize=22, leading=30, alignment=1, spaceAfter=20)h1_style = ParagraphStyle("H1", fontName="SimHei", fontSize=16, leading=24, spaceBefore=15, spaceAfter=10)h2_style = ParagraphStyle("H2", fontName="SimHei", fontSize=13, leading=20, spaceBefore=10, spaceAfter=8)body_style = ParagraphStyle("Body", fontName="SimSun", fontSize=11, leading=18, firstLineIndent=22)cell_style = ParagraphStyle("Cell", fontName="SimSun", fontSize=10, leading=14, alignment=1)header_style = ParagraphStyle("Header", fontName="SimHei", fontSize=10, leading=14, alignment=1, textColor=colors.white)# 构建报告doc = SimpleDocTemplate("business_report.pdf", pagesize=A4, topMargin=2*cm, bottomMargin=2*cm)story = []# 封面标题story.append(Spacer(1, 3*cm))story.append(Paragraph("2024年第三季度业务报告", title_style))story.append(Spacer(1, 1*cm))story.append(Paragraph("报告周期:2024年7月1日 - 9月30日", ParagraphStyle("Sub", fontName="SimSun", fontSize=12, alignment=1)))story.append(PageBreak())# 第一章:概述story.append(Paragraph("一、报告概述", h1_style))story.append(Paragraph("2024年第三季度,公司整体业务保持稳健增长。核心指标方面,销售额达到1,720万元,环比增长16.2%;客户总数达到452家,环比增长17.4%;复购率提升至35%,客户粘性持续增强。", body_style))story.append(Spacer(1, 0.3*cm))# 第二章:核心指标story.append(Paragraph("二、核心指标汇总", h1_style))story.append(Spacer(1, 0.3*cm))data = [    [Paragraph("指标", header_style), Paragraph("Q1", header_style), Paragraph("Q2", header_style), Paragraph("Q3", header_style), Paragraph("环比", header_style)],    [Paragraph("销售额(万元)", cell_style), Paragraph("1,250", cell_style), Paragraph("1,480", cell_style), Paragraph("1,720", cell_style), Paragraph("+16.2%", cell_style)],    [Paragraph("客户数", cell_style), Paragraph("320", cell_style), Paragraph("385", cell_style), Paragraph("452", cell_style), Paragraph("+17.4%", cell_style)],    [Paragraph("客单价(元)", cell_style), Paragraph("390", cell_style), Paragraph("384", cell_style), Paragraph("380", cell_style), Paragraph("-1.0%", cell_style)],    [Paragraph("复购率", cell_style), Paragraph("28%", cell_style), Paragraph("31%", cell_style), Paragraph("35%", cell_style), Paragraph("+4pp", cell_style)],]table = Table(data, colWidths=[4*cm, 2.5*cm, 2.5*cm, 2.5*cm, 2.5*cm])table.setStyle(TableStyle([    ("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#2E5BFF")),    ("GRID", (0, 0), (-1, -1), 0.5, colors.grey),    ("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.white, colors.HexColor("#F5F7FA")]),    ("TOPPADDING", (0, 0), (-1, -1), 8),    ("BOTTOMPADDING", (0, 0), (-1, -1), 8),    ("VALIGN", (0, 0), (-1, -1), "MIDDLE"),]))story.append(table)# 插入图表(假设已用matplotlib生成)story.append(Spacer(1, 0.5*cm))story.append(Paragraph("季度销售额趋势图", h2_style))story.append(Image("sales_chart.png", width=14*cm, height=7*cm))# 生成doc.build(story)print("完整业务报告生成成功: business_report.pdf")

07 页眉页脚和页码

专业报告通常需要页眉页脚和页码。用 onFirstPage 和 onLaterPages 回调函数实现:

from reportlab.lib.pagesizes import A4from reportlab.platypus import SimpleDocTemplate, Paragraphfrom reportlab.lib.units import cmdef add_header_footer(canvas, doc):    canvas.saveState()    # 页眉    canvas.setFont("SimHei"9)    canvas.drawString(2*cm, A4[1] - 1.5*cm, "2024年Q3业务报告")    canvas.drawRightString(A4[0] - 2*cm, A4[1] - 1.5*cm, "机密文件")    # 页眉线    canvas.setStrokeColorRGB(0.50.50.5)    canvas.line(2*cm, A4[1] - 1.7*cm, A4[0] - 2*cm, A4[1] - 1.7*cm)    # 页脚页码    canvas.setFont("SimSun"9)    page_num = canvas.getPageNumber()    canvas.drawCentredString(A4[0]/21.2*cm, f"- {page_num} -")    canvas.restoreState()doc = SimpleDocTemplate(    "report_with_header.pdf",    pagesize=A4,    topMargin=2.5*cm,    bottomMargin=2*cm,)doc.build(story, onFirstPage=add_header_footer, onLaterPages=add_header_footer)

08 常见坑与解决方案

坑 1:中文显示为方框

必须注册中文字体,且所有用到中文的样式都要指定 fontName 为注册的中文字体。别忘了图表中的中文也要设置字体。

坑 2:表格内容溢出

如果单元格内容太长,会溢出表格。解决方法:1)用 Paragraph 包裹单元格内容,支持自动换行;2)调整列宽;3)缩小字号。

坑 3:图片模糊

插入的图片分辨率不够会模糊。用 matplotlib 生成图表时设置 dpi=150 或更高。插入图片时按比例缩放,不要拉伸变形。

坑 4:分页时表格被截断

长表格跨页时,reportlab 默认会把表格整体放在一页,放不下就会报错或留白。解决方法:使用 LongTable 替代 Table,它支持自动跨页。或者把大表格拆成多个小表格。

写在最后

用 reportlab 生成 PDF 业务报告,前期需要花时间搭建模板和样式,但一旦模板建好,后续每月只需要更新数据,跑一下脚本就能生成一份格式统一、排版精美的报告。这就是自动化的价值:把重复劳动交给代码,把创造性工作留给自己

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-09-01 06:27:10 HTTP/2.0 GET : https://f.mffb.com.cn/a/512369.html
  2. 运行时间 : 0.207344s [ 吞吐率:4.82req/s ] 内存消耗:4,738.19kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=2107062a5192c432a1c6c0423f0a63fb
  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.001133s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001517s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.001812s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000698s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001320s ]
  6. SELECT * FROM `set` [ RunTime:0.000606s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001497s ]
  8. SELECT * FROM `article` WHERE `id` = 512369 LIMIT 1 [ RunTime:0.001099s ]
  9. UPDATE `article` SET `lasttime` = 1788215230 WHERE `id` = 512369 [ RunTime:0.003731s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000700s ]
  11. SELECT * FROM `article` WHERE `id` < 512369 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001138s ]
  12. SELECT * FROM `article` WHERE `id` > 512369 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001369s ]
  13. SELECT * FROM `article` WHERE `id` < 512369 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.012271s ]
  14. SELECT * FROM `article` WHERE `id` < 512369 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.005800s ]
  15. SELECT * FROM `article` WHERE `id` < 512369 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.005893s ]
0.211198s