当前位置:首页>python>第340讲:分别用 Python 和 VBA 来实现“财务报表自动生成PDF + 自动邮件发送”

第340讲:分别用 Python 和 VBA 来实现“财务报表自动生成PDF + 自动邮件发送”

  • 2026-08-18 23:11:39
第340讲:分别用 Python 和 VBA 来实现“财务报表自动生成PDF + 自动邮件发送”

场景:每月财务报表生成PDF并自动发送给管理层

每到月底,财务部门的“固定节目”总是少不了:整理Excel台账 → 调整格式 → 另存为PDF → 打开Outlook → 逐一添加附件 → 核对收件人 → 点击发送。一旦涉及多家子公司、多份报表,这套流程不仅重复度高,还极易出现漏发、错发、版本不一致等问题。

今天我们就从实战角度,分别用 Python 和 VBA 来实现“财务报表自动生成PDF + 自动邮件发送”,并在过程中穿插技术细节、踩坑经验和性能对比,帮你在真实工作中选对工具。


一、业务场景拆解:我们要解决什么问题?

先不谈代码,先把需求拆清楚,这是自动化是否成功的关键。

典型月度财务报表场景:

  1. 数据源:Excel台账(多个Sheet:利润表、资产负债表、现金流量表)

  2. 格式要求

    • 统一页眉页脚(公司名称、期间、页码)

    • 中文字体正常显示(尤其是Windows+Linux环境)

    • 表格边框、对齐方式符合财务规范

  3. 输出文件

    • 按“公司名2026年07月财务报表.pdf”命名

  4. 分发要求

    • 发送给对应公司负责人 + 抄送CFO

    • 邮件正文包含本期关键指标(营收、净利润)

  5. 运行环境

    • 财务同事:Windows + Excel + Outlook

    • 服务器/云环境:Linux / Windows Server(无桌面)

核心痛点:

  • VBA:强依赖Windows和Outlook,迁移困难

  • Python:环境配置稍复杂,但可跨平台、可定时任务

接下来我们分别落地。


二、VBA方案:深度绑定Office的“原生解法”

VBA的最大优势是:几乎零部署成本。只要装了Office,就能跑。

1. VBA生成PDF:ExportAsFixedFormat

假设当前工作簿就是财务报表模板,Sheet1为封面,Sheet2~4为三大表。

Sub ExportFinanceReport()    Dim wb As Workbook    Dim pdfPath As String    Dim companyName As String    Dim reportMonth As String    Set wb = ThisWorkbook    companyName = "华东科技"    reportMonth = "2026年07月"    ' 统一路径,避免中文路径乱码    pdfPath = wb.Path & "\" & companyName & "_" & reportMonth & "_财务报表.pdf"    ' 选择需要导出的Sheet(可改为数组)    wb.Sheets(Array("封面", "利润表", "资产负债表", "现金流量表")).Select    ' 导出PDF    ActiveSheet.ExportAsFixedFormat _        Type:=xlTypePDF, _        Filename:=pdfPath, _        Quality:=xlQualityStandard, _        IncludeDocProperties:=True, _        IgnorePrintAreas:=False    MsgBox "PDF生成完成:" & pdfPath, vbInformationEnd Sub

关键参数说明:

  • IgnorePrintAreas:=False:严格遵守“打印区域”,避免多出空白页(财务最忌讳)

  • IncludeDocProperties:保留作者、主题等元数据,便于归档

常见坑点:

  • Excel未设置打印区域 → PDF出现大量空白页

  • 文件路径含特殊字符 → 导出失败

  • 未激活目标Sheet → 只导出当前活动页

✅ 经验建议:在模板中预设好“打印区域”和“页面缩放”,VBA只负责调用。


2. VBA调用Outlook自动发邮件

VBA通过COM接口直接控制Outlook,这是它最强的护城河。

Sub SendReportViaOutlook()    Dim outlookApp As Outlook.Application    Dim mail As Outlook.MailItem    Dim pdfPath As String    pdfPath = ThisWorkbook.Path & "\华东科技_2026年07月_财务报表.pdf"    ' 创建Outlook应用对象    Set outlookApp = New Outlook.Application    Set mail = outlookApp.CreateItem(olMailItem)    With mail        .To = "ceo@huadong.com"        .CC = "cfo@group.com"        .Subject = "华东科技2026年07月财务报表"        .Body = "尊敬的领导:" & vbCrLf & vbCrLf & _                "附件为华东科技2026年07月财务报表,请查收。" & vbCrLf & _                "本期营收:1,280万元;净利润:214万元。" & vbCrLf & vbCrLf & _                "财务部"        .Attachments.Add pdfPath        .Send   ' 若想人工确认,可改为 .Display    End With    Set mail = Nothing    Set outlookApp = Nothing    MsgBox "邮件已发送", vbInformationEnd Sub

亮点:

  • .Send:全自动无人值守

  • .Display:半自动,适合初次上线时人工复核

局限:

  • 必须安装并配置Outlook

  • 受Outlook安全策略限制(可能弹窗确认)

  • 无法在服务器端无桌面环境运行


三、Python方案:跨平台的“工程化解法”

Python的优势不在于“快”,而在于可控性、可扩展性和跨平台能力

我们将使用:

  • pdfkit:基于wkhtmltopdf,适合将HTML转PDF(报表样式友好)

  • reportlab:适合完全程序化生成PDF(适合复杂表格)

  • smtplib + email:标准库发邮件,不依赖客户端

下面我们先用pdfkit(更接近前端思维,适合财务模板),再补充reportlab对比。


1. 环境准备(一次投入,长期受益)

pip install pdfkit pandas openpyxl
# 系统级依赖(必须单独安装)
# Windows: 下载 wkhtmltopdf.exe 并加入PATH
# Linux: sudo apt install wkhtmltopdf

⚠️ 注意:很多初学者卡在这一步——pdfkit只是封装,真正干活的是wkhtmltopdf


2. Python + pdfkit:从Excel到PDF

思路:

Excel → Pandas读取 → 生成HTML表格 → pdfkit转PDF

import pandas as pdimport pdfkitfrom datetime import datetimedef excel_to_pdf_html(excel_path, sheet_name):    """读取Excel,返回HTML字符串"""    df = pd.read_excel(excel_path, sheet_name=sheet_name)    html = df.to_html(index=False, border=1, encoding='utf-8')    # 注入基础样式(财务表格必备)    styled_html = f"""    <!DOCTYPE html>    <html>    <head>        <meta charset="UTF-8">        <style>            body {{                font-family: "SimSun", "Microsoft YaHei", serif;                font-size: 12px;            }}            table {{                border-collapse: collapse;                width: 100%;            }}            th, td {{                border: 1px solid black;                padding: 4px;                text-align: right;            }}            th {{                background-color: #f2f2f2;            }}        </style>    </head>    <body>        <h2 style="text-align:center;">{sheet_name}</h2>        {html}    </body>    </html>    """    return styled_htmldef generate_finance_pdf():    excel_path = r"D:\Finance\2026July.xlsx"    sheets = ["利润表""资产负债表""现金流量表"]    options = {        'encoding'"UTF-8",        'page-size''A4',        'margin-top''15mm',        'margin-bottom''15mm',        'footer-center''[page]/[topage]'    }    html_parts = []    for sheet in sheets:        html_parts.append(excel_to_pdf_html(excel_path, sheet))    full_html = "<div style='page-break-after:always;'></div>".join(html_parts)    pdf_path = r"D:\Finance\华东科技_2026年07月_财务报表.pdf"    pdfkit.from_string(full_html, pdf_path, options=options)    return pdf_pathif __name__ == "__main__":    pdf_file = generate_finance_pdf()    print(f"PDF生成完成:{pdf_file}")

专业提示:

  • 中文字体问题:Linux服务器需安装中文字体包(fonts-wqy-zenhei

  • 分页控制:page-break-after:always比Excel分页符更稳定

  • HTML模板化:可将CSS抽离为独立文件,方便财务调整样式


3. Python + reportlab:完全代码化生成PDF(进阶)

当你需要精确控制每一行每一列的位置(如审计底稿),reportlab更合适。

from reportlab.lib.pagesizes import A4from reportlab.pdfgen import canvasfrom reportlab.lib.units import mmfrom reportlab.pdfbase import pdfmetricsfrom reportlab.pdfbase.ttfonts import TTFontdef generate_pdf_reportlab():    # 注册中文字体(关键)    pdfmetrics.registerFont(TTFont('SimSun''SimSun.ttf'))    c = canvas.Canvas("财务报表_reportlab.pdf", pagesize=A4)    width, height = A4    # 页眉    c.setFont("SimSun"14)    c.drawCentredText(width / 2, height - 20 * mm, "华东科技2026年07月利润表")    # 表格示例(简化版)    c.setFont("SimSun"10)    data = [        ("项目""本月数""本年累计"),        ("营业收入""12,800,000.00""85,300,000.00"),        ("净利润""2,140,000.00""13,200,000.00")    ]    y = height - 40 * mm    for row in data:        x = 30 * mm        for cell in row:            c.drawString(x, y, str(cell))            x += 60 * mm        y -= 8 * mm    c.save()if __name__ == "__main__":    generate_pdf_reportlab()

对比总结:

特性

pdfkit

reportlab

上手难度

⭐⭐

⭐⭐⭐⭐

样式灵活性

⭐⭐⭐⭐⭐

⭐⭐⭐

中文支持

依赖系统字体

显式注册字体

适合场景

报表展示

票据、底稿


4. Python发送邮件:smtplib(不依赖Outlook)

这是Python最大的优势之一:不依赖任何邮件客户端

import smtplibfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipartfrom email.mime.application import MIMEApplicationdef send_email_with_attachment(pdf_path):    sender = "finance@company.com"    receiver = "ceo@huadong.com"    cc = "cfo@group.com"    password = "your_email_password"  # 建议使用环境变量    msg = MIMEMultipart()    msg['From'] = sender    msg['To'] = receiver    msg['Cc'] = cc    msg['Subject'] = "华东科技2026年07月财务报表"    body = """尊敬的领导:附件为华东科技2026年07月财务报表,请查收。本期关键指标:- 营业收入:1,280万元- 净利润:214万元财务部"""    msg.attach(MIMEText(body, 'plain''utf-8'))    # 添加附件    with open(pdf_path, 'rb'as f:        attach = MIMEApplication(f.read(), _subtype="pdf")        attach.add_header(            'Content-Disposition',            'attachment',            filename="华东科技_2026年07月_财务报表.pdf"        )        msg.attach(attach)    # SMTP发送(以QQ邮箱为例)    with smtplib.SMTP_SSL("smtp.qq.com"465as server:        server.login(sender, password)        server.send_message(msg)    print("邮件发送成功")if __name__ == "__main__":    pdf_file = "D:/Finance/华东科技_2026年07月_财务报表.pdf"    send_email_with_attachment(pdf_file)

企业级建议:

  • 密码不要硬编码 → 使用环境变量或配置文件

  • 使用企业邮箱SMTP,避免个人邮箱被拦截

  • Linux服务器注意防火墙放行SMTP端口(465/587)


四、Python vs VBA:深度对照分析

维度

Python

VBA

运行环境

Windows / Linux / macOS

仅Windows + Office

PDF生成

HTML/CSS控制,样式灵活

依赖Excel打印设置

邮件发送

SMTP协议,无需客户端

强依赖Outlook

可维护性

模块化、易测试

代码分散在各工作簿

定时任务

cron / Windows Task Scheduler

需配合VBScript

学习曲线

较陡,但生态丰富

低,但天花板明显

适用人群

IT/财务BP/数据分析师

普通财务用户

一句话总结:

VBA是“让Excel自己干活”,Python是“把Excel放进自动化流水线”。


五、实战推荐方案

  • 财务单机操作:VBA一键按钮,简单直观

  • 部门级自动化:Python脚本 + Windows计划任务

  • 集团级报表平台:Python + 数据库 + Web服务(如FastAPI)


六、课后练习(选择题)

  1. VBA中,用于导出PDF的核心方法是:

    A. SaveAsPDF

    B. ExportAsFixedFormat

    C. PrintOut

    D. ConvertToPDF

  2. Python使用pdfkit生成PDF时,真正执行转换的系统组件是:

    A. Chrome

    B. wkhtmltopdf

    C. Ghostscript

    D. LibreOffice

  3. 下列Python库中,最适合精确控制PDF坐标和表格绘制的是:

    A. pdfkit

    B. reportlab

    C. PyPDF2

    D. FPDF

  4. Python发送邮件时,若不依赖Outlook,通常使用哪个标准库?

    A. imaplib

    B. smtplib

    C. exchangelib

    D. win32com

  5. 在企业服务器环境中,Python相比VBA的最大优势是:

    A. 语法更简单

    B. 跨平台、无桌面依赖

    C. 更适合做图表

    D. 可直接修改Excel公式


参考答案

  1. B

  2. B

  3. B

  4. B

  5. B


📌 有偿数据分析咨询开放

表格自动化|Power BI|帆软 BI|Python小工具定制|VBA小工具定义|AI 智能体|数据清洗|项目方案|技术指导

遇到数据难题,直接私信沟通需求。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-08-22 01:41:07 HTTP/2.0 GET : https://f.mffb.com.cn/a/508504.html
  2. 运行时间 : 3.148015s [ 吞吐率:0.32req/s ] 内存消耗:4,626.55kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=b5e537086df709f06078dd9d83820c8a
  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.000345s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000596s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.100580s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.100766s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001563s ]
  6. SELECT * FROM `set` [ RunTime:0.100923s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001796s ]
  8. SELECT * FROM `article` WHERE `id` = 508504 LIMIT 1 [ RunTime:0.101329s ]
  9. UPDATE `article` SET `lasttime` = 1787334067 WHERE `id` = 508504 [ RunTime:2.046890s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.101157s ]
  11. SELECT * FROM `article` WHERE `id` < 508504 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.101521s ]
  12. SELECT * FROM `article` WHERE `id` > 508504 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.101477s ]
  13. SELECT * FROM `article` WHERE `id` < 508504 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.102820s ]
  14. SELECT * FROM `article` WHERE `id` < 508504 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.102285s ]
  15. SELECT * FROM `article` WHERE `id` < 508504 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.102427s ]
3.151491s