乐于分享
好东西不私藏

第259讲:批量合并多个Excel文件(结构相同),VBA和Python双方案

第259讲:批量合并多个Excel文件(结构相同),VBA和Python双方案

在日常数据处理工作中,经常会遇到需要将多个结构相同的Excel文件合并成一个总表的情况。比如各地分公司每月提交的销售报表、各部门的预算执行表、或者每日生成的日志文件等。手动合并费时费力,还容易出错。本文将详细介绍如何使用Python和VBA两种方法实现Excel文件的批量合并,并分析两种方法的适用场景。

一、应用场景深度分析

1.1 典型业务场景

假设你是一家零售企业的数据分析员,负责全国销售数据的汇总分析。每月初,全国30个分公司会分别提交一份销售报表,这些报表都包含相同的列结构:销售日期产品编号产品名称销售数量销售金额客户类型等。你需要将这些分散的Excel文件合并成一个总表,用于:

  • 月度销售业绩汇总

  • 各区域销售对比分析

  • 年度累计统计

  • 制作统一的数据看板

1.2 手动合并的痛点

  1. 时间成本高:30个文件逐个打开、复制、粘贴,至少需要1-2小时

  2. 容易出错:可能遗漏文件、重复复制、数据错位

  3. 不可重复:下个月需要重新操作一遍

  4. 版本管理困难:难以追溯每个文件的处理状态

二、Python实现方法详解

2.1 环境准备

Python在数据处理方面有天然优势,主要使用以下库:

# 安装所需库# pip install pandas openpyxlimport pandas as pdimport globimport osfrom datetime import datetime

2.2 基础版:简单合并

def merge_excel_basic(folder_path, output_file="合并结果.xlsx"):    """    基础版合并:合并指定文件夹下所有Excel文件    参数:    folder_path: Excel文件所在文件夹路径    output_file: 输出文件名    """    # 获取所有Excel文件路径    # 支持.xlsx和.xls格式    file_pattern = os.path.join(folder_path, "*.xlsx")    excel_files = glob.glob(file_pattern)    # 如果没有.xlsx文件,尝试.xls    if not excel_files:        file_pattern = os.path.join(folder_path, "*.xls")        excel_files = glob.glob(file_pattern)    if not excel_files:        print(f"在{folder_path}中未找到Excel文件")        return    print(f"找到{len(excel_files)}个Excel文件,开始合并...")    # 读取并合并所有文件    df_list = []    for file in excel_files:        try:            # 读取Excel文件            # sheet_name=None 读取所有工作表            # sheet_name=0 读取第一个工作表            df = pd.read_excel(file, sheet_name=0)            # 添加文件名列,便于追溯数据来源            df['源文件'] = os.path.basename(file)            df_list.append(df)            print(f"✓ 已读取: {os.path.basename(file)} - {len(df)}行")        except Exception as e:            print(f"✗ 读取失败: {file}, 错误: {str(e)}")            continue    if df_list:        # 合并所有DataFrame        combined_df = pd.concat(df_list, ignore_index=True, sort=False)        # 保存合并结果        combined_df.to_excel(output_file, index=False)        print(f"\n合并完成!总行数: {len(combined_df)}")        print(f"结果保存至: {output_file}")        # 显示数据预览        print("\n数据预览:")        print(combined_df.head())        return combined_df    else:        print("没有成功读取任何文件")        return None

2.3 进阶版:处理复杂情况

实际工作中,可能会遇到各种复杂情况,需要更健壮的代码:

def merge_excel_advanced(folder_path, output_file=None                         sheet_name=0, header_row=0,                         required_columns=None,                         skip_files=None):    """    进阶版合并:处理更复杂的合并需求    参数:    folder_path: 文件夹路径    output_file: 输出文件路径,默认为"合并结果_时间戳.xlsx"    sheet_name: 工作表名或索引    header_row: 表头所在行(0-based)    required_columns: 必须包含的列,用于验证文件结构    skip_files: 需要跳过的文件名列表    """    # 设置默认输出文件名    if output_file is None:        timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")        output_file = f"合并结果_{timestamp}.xlsx"    # 获取所有Excel文件    excel_files = []    for ext in ['*.xlsx''*.xls''*.xlsm']:        excel_files.extend(glob.glob(os.path.join(folder_path, ext)))    if not excel_files:        print("未找到任何Excel文件")        return    # 过滤需要跳过的文件    if skip_files:        excel_files = [f for f in excel_files                       if os.path.basename(f) not in skip_files]    print(f"开始处理{len(excel_files)}个文件...")    print("-" * 50)    df_list = []    error_files = []    success_count = 0    for i, file_path in enumerate(excel_files, 1):        file_name = os.path.basename(file_path)        print(f"[{i}/{len(excel_files)}] 处理: {file_name}")        try:            # 读取Excel文件            df = pd.read_excel(                file_path,                sheet_name=sheet_name,                header=header_row,                dtype=str  # 统一按字符串读取,避免类型问题            )            # 验证必要的列是否存在            if required_columns:                missing_cols = [col for col in required_columns                               if col not in df.columns]                if missing_cols:                    raise ValueError(f"缺少必要列: {missing_cols}")            # 添加元数据            df['源文件'] = file_name            df['处理时间'] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")            # 清理列名(去除空格等)            df.columns = df.columns.str.strip()            df_list.append(df)            success_count += 1            print(f"   ✓ 成功读取,行数: {len(df)}")        except Exception as e:            error_files.append((file_name, str(e)))            print(f"   ✗ 读取失败: {str(e)}")        print("-" * 50)    # 合并数据    if df_list:        try:            # 合并所有DataFrame            combined_df = pd.concat(df_list, ignore_index=True)            # 保存结果            with pd.ExcelWriter(output_file, engine='openpyxl'as writer:                combined_df.to_excel(writer, index=False, sheet_name='合并数据')                # 添加汇总信息工作表                summary_data = {                    '统计项': ['总文件数''成功合并数''失败数''总行数''处理时间'],                    '数值': [len(excel_files), success_count,                            len(error_files), len(combined_df),                           datetime.now().strftime("%Y-%m-%d %H:%M:%S")]                }                summary_df = pd.DataFrame(summary_data)                summary_df.to_excel(writer, index=False, sheet_name='合并汇总')                # 如果有错误,添加错误信息工作表                if error_files:                    error_df = pd.DataFrame(error_files, columns=['文件名''错误信息'])                    error_df.to_excel(writer, index=False, sheet_name='错误文件')            print("\n" + "="*50)            print("合并完成!")            print(f"成功合并文件: {success_count}/{len(excel_files)}")            print(f"总数据行数: {len(combined_df)}")            print(f"输出文件: {output_file}")            if error_files:                print(f"失败文件数: {len(error_files)}")                for f, e in error_files:                    print(f"  - {f}{e}")            return combined_df        except Exception as e:            print(f"合并过程中发生错误: {str(e)}")            return None    else:        print("没有成功读取任何文件")        return None# 使用示例if __name__ == "__main__":    # 定义必须包含的列    required_cols = ['销售日期''产品编号''销售金额''客户类型']    # 定义要跳过的文件    skip_list = ['模板.xlsx''测试数据.xlsx']    result = merge_excel_advanced(        folder_path="./销售数据/",        sheet_name=0,        header_row=0,        required_columns=required_cols,        skip_files=skip_list    )

2.4 增强功能:数据清洗与转换

在合并过程中,通常需要进行数据清洗:

def clean_and_merge_excel(folder_path, output_file):    """    合并时进行数据清洗    """    excel_files = glob.glob(os.path.join(folder_path, "*.xlsx"))    df_list = []    for file in excel_files:        df = pd.read_excel(file)        # 数据清洗步骤        # 1. 去除列名空格        df.columns = df.columns.str.strip()        # 2. 统一日期格式        date_columns = [col for col in df.columns if '日期' in col or 'date' in col.lower()]        for col in date_columns:            if col in df.columns:                try:                    df[col] = pd.to_datetime(df[col], errors='coerce')                except:                    pass        # 3. 统一金额格式(去除千分位逗号)        amount_columns = [col for col in df.columns if '金额' in col or 'amount' in col.lower()]        for col in amount_columns:            if col in df.columns:                # 如果是字符串,去除逗号和货币符号                if df[col].dtype == 'object':                    df[col] = df[col].astype(str).str.replace(',''').str.replace('¥''').str.replace('$''')                    # 转换为数值                    df[col] = pd.to_numeric(df[col], errors='coerce')        # 4. 去除空行        df = df.dropna(how='all')        # 5. 重置索引        df = df.reset_index(drop=True)        df_list.append(df)    # 合并    combined_df = pd.concat(df_list, ignore_index=True)    # 保存    combined_df.to_excel(output_file, index=False)    return combined_df

三、VBA实现方法详解

3.1 基础版VBA合并代码

对于习惯使用Excel的用户,VBA提供了一个无需安装额外软件的解决方案:

Sub MergeExcelFilesBasic()    ' 基础版:合并多个Excel文件    Dim fileNames As Variant    Dim i As Long    Dim sourceWb As Workbook    Dim sourceWs As Worksheet    Dim targetWs As Worksheet    Dim lastRow As Long    Dim targetLastRow As Long    Dim fileCount As Long    Dim totalRows As Long    ' 设置目标工作表    Set targetWs = ThisWorkbook.Worksheets("合并结果")    ' 清除旧数据(保留标题行)    targetWs.Range("A2:Z" & targetWs.Rows.Count).ClearContents    ' 获取目标表的最后一行(从第2行开始,假设第1行是标题)    targetLastRow = 2    ' 让用户选择多个Excel文件    fileNames = Application.GetOpenFilename( _        FileFilter:="Excel Files (*.xlsx; *.xls; *.xlsm), *.xlsx; *.xls; *.xlsm", _        Title:="请选择要合并的Excel文件(可多选)", _        MultiSelect:=True)    ' 检查是否选择了文件    If Not IsArray(fileNames) Then        MsgBox "没有选择任何文件。", vbInformation        Exit Sub    End If    fileCount = 0    totalRows = 0    ' 禁用屏幕更新和自动计算,提高性能    Application.ScreenUpdating = False    Application.Calculation = xlCalculationManual    Application.DisplayAlerts = False    ' 遍历每个文件    For i = LBound(fileNames) To UBound(fileNames)        On Error Resume Next        Set sourceWb = Workbooks.Open(fileNames(i), ReadOnly:=True)        If Err.Number = 0 Then            ' 假设数据在第一个工作表            Set sourceWs = sourceWb.Worksheets(1)            ' 获取源数据的最后一行            lastRow = sourceWs.Cells(sourceWs.Rows.Count, 1).End(xlUp).Row            ' 如果文件有数据(大于1行,假设第1行是标题)            If lastRow > 1 Then                ' 复制数据(从第2行开始,避免重复标题)                If fileCount = 0 Then                    ' 第一个文件:复制标题和数据                    sourceWs.Range("A1").Resize(lastRow, sourceWs.Columns.Count).Copy _                        targetWs.Cells(targetLastRow, 1)                    targetLastRow = targetLastRow + lastRow                Else                    ' 后续文件:只复制数据(不复制标题)                    sourceWs.Range("A2").Resize(lastRow - 1, sourceWs.Columns.Count).Copy _                        targetWs.Cells(targetLastRow, 1)                    targetLastRow = targetLastRow + lastRow - 1                End If                totalRows = totalRows + lastRow - 1                fileCount = fileCount + 1            End If            ' 关闭源工作簿            sourceWb.Close SaveChanges:=False        Else            ' 记录错误文件            Debug.Print "无法打开文件: " & fileNames(i) & " 错误: " & Err.Description            Err.Clear        End If        On Error GoTo 0    Next i    ' 恢复设置    Application.ScreenUpdating = True    Application.Calculation = xlCalculationAutomatic    Application.DisplayAlerts = True    ' 显示汇总信息    Dim msg As String    msg = "合并完成!" & vbCrLf & _          "处理文件数: " & fileCount & "个" & vbCrLf & _          "总数据行数: " & totalRows & "行" & vbCrLf & _          "合并到: " & targetWs.Name & "工作表"    MsgBox msg, vbInformation, "合并结果"    ' 激活目标工作表    targetWs.ActivateEnd Sub

3.2 进阶版VBA:带错误处理和日志记录

Sub MergeExcelFilesAdvanced()    ' 进阶版:带错误处理、日志记录和进度显示    Dim fileNames As Variant    Dim i As Long    Dim sourceWb As Workbook    Dim sourceWs As Worksheet    Dim targetWs As Worksheet    Dim logWs As Worksheet    Dim lastRow As Long    Dim targetLastRow As Long    Dim startTime As Double    Dim endTime As Double    Dim totalTime As Double    Dim fileCount As Long, successCount As Long, failCount As Long    Dim totalRows As Long    ' 记录开始时间    startTime = Timer    ' 创建或选择日志工作表    On Error Resume Next    Set logWs = ThisWorkbook.Worksheets("合并日志")    If logWs Is Nothing Then        Set logWs = ThisWorkbook.Worksheets.Add(After:=ThisWorkbook.Worksheets(ThisWorkbook.Worksheets.Count))        logWs.Name = "合并日志"        ' 设置日志标题        With logWs            .Range("A1") = "文件名"            .Range("B1") = "状态"            .Range("C1") = "数据行数"            .Range("D1") = "错误信息"            .Range("E1") = "处理时间"            .Rows(1).Font.Bold = True        End With    End If    On Error GoTo 0    ' 设置目标工作表    On Error Resume Next    Set targetWs = ThisWorkbook.Worksheets("合并数据")    If targetWs Is Nothing Then        Set targetWs = ThisWorkbook.Worksheets.Add        targetWs.Name = "合并数据"    End If    On Error GoTo 0    ' 清除目标表的旧数据    targetWs.Cells.Clear    targetLastRow = 1    ' 选择文件    fileNames = Application.GetOpenFilename( _        FileFilter:="Excel Files (*.xlsx; *.xls; *.xlsm), *.xlsx; *.xls; *.xlsm", _        Title:="请选择要合并的Excel文件(可多选)", _        MultiSelect:=True)    If Not IsArray(fileNames) Then        MsgBox "操作已取消。", vbInformation        Exit Sub    End If    ' 性能优化设置    Application.ScreenUpdating = False    Application.Calculation = xlCalculationManual    Application.DisplayAlerts = False    Application.EnableEvents = False    fileCount = 0    successCount = 0    failCount = 0    totalRows = 0    ' 显示进度条    Dim progress As Object    Set progress = CreateProgressBar(UBound(fileNames) - LBound(fileNames) + 1, "正在合并文件...")    ' 遍历文件    For i = LBound(fileNames) To UBound(fileNames)        Dim fileName As String        Dim filePath As String        Dim logRow As Long        Dim hasTitle As Boolean        filePath = fileNames(i)        fileName = Dir(filePath)        ' 更新进度条        progress.Update i - LBound(fileNames) + 1, "正在处理: " & fileName        ' 确定日志行        logRow = logWs.Cells(logWs.Rows.Count, 1).End(xlUp).Row + 1        If logRow = 2 And logWs.Range("A2") = "" Then logRow = 2        ' 记录基本信息        logWs.Cells(logRow, 1) = fileName        logWs.Cells(logRow, 5) = Now()        On Error Resume Next        ' 尝试打开文件        Set sourceWb = Workbooks.Open(filePath, ReadOnly:=True, UpdateLinks:=0)        If Err.Number = 0 Then            ' 成功打开文件            Set sourceWs = sourceWb.Worksheets(1)            lastRow = sourceWs.Cells(sourceWs.Rows.Count, 1).End(xlUp).Row            ' 检查是否有数据            If lastRow > 0 Then                ' 判断是否需要复制标题                hasTitle = (targetLastRow = 1) ' 如果是第一行,需要标题                If hasTitle Then                    ' 复制整个范围(包括标题)                    sourceWs.UsedRange.Copy targetWs.Cells(targetLastRow, 1)                    targetLastRow = targetLastRow + lastRow                Else                    ' 不复制标题行                    If lastRow > 1 Then                        sourceWs.Range("A2:A" & lastRow).EntireRow.Copy targetWs.Cells(targetLastRow, 1)                        targetLastRow = targetLastRow + lastRow - 1                    End If                End If                ' 更新计数                totalRows = totalRows + IIf(hasTitle, lastRow, lastRow - 1)                successCount = successCount + 1                ' 记录成功                logWs.Cells(logRow, 2= "成功"                logWs.Cells(logRow, 3= IIf(hasTitle, lastRow, lastRow - 1)            Else                ' 空文件                logWs.Cells(logRow, 2) = "空文件"                logWs.Cells(logRow, 4) = "文件无数据"                failCount = failCount + 1            End If            ' 关闭文件            sourceWb.Close SaveChanges:=False        Else            ' 打开文件失败            logWs.Cells(logRow, 2) = "失败"            logWs.Cells(logRow, 4) = Err.Description            failCount = failCount + 1            Err.Clear        End If        On Error GoTo 0        fileCount = fileCount + 1    Next i    ' 关闭进度条    progress.CloseProgressBar    ' 恢复设置    Application.ScreenUpdating = True    Application.Calculation = xlCalculationAutomatic    Application.DisplayAlerts = True    Application.EnableEvents = True    ' 记录结束时间    endTime = Timer    totalTime = endTime - startTime    ' 格式调整    If targetLastRow > 1 Then        targetWs.Range("A1").CurrentRegion.Columns.AutoFit        targetWs.Range("A1").CurrentRegion.Rows(1).Font.Bold = True    End If    logWs.Columns.AutoFit    ' 显示汇总    Dim summary As String    summary = "合并完成!" & vbCrLf & vbCrLf & _              "总计文件: " & fileCount & " 个" & vbCrLf & _              "成功合并: " & successCount & " 个" & vbCrLf & _              "失败文件: " & failCount & " 个" & vbCrLf & _              "总数据行: " & totalRows & " 行" & vbCrLf & _              "处理时间: " & Format(totalTime, "0.00") & " 秒" & vbCrLf & vbCrLf & _              "详细日志请查看【合并日志】工作表"    MsgBox summary, vbInformation, "合并结果汇总"    ' 激活目标表    targetWs.Activate    targetWs.Range("A1").SelectEnd Sub' 进度条函数(需要放在标准模块中)Function CreateProgressBar(maxValue As Long, Optional title As String = "进度") As Object    ' 创建进度条的用户窗体    ' 这里简化处理,实际使用中需要创建ProgressBar用户窗体    ' 返回一个模拟进度条对象    Dim progress As Object    Set progress = New ProgressBarClass    progress.Init maxValue, title    Set CreateProgressBar = progressEnd Function

3.3 创建用户界面

为了让VBA工具更易用,可以创建一个用户界面:

' 在工作表中创建按钮,并指定宏Sub ShowMergeDialog()    ' 显示合并对话框    ' 这里可以创建一个用户窗体,让用户选择更多选项    ' 例如:是否包含标题、选择特定工作表、设置输出位置等    Dim frm As New frmMergeOptions    frm.ShowEnd Sub

四、Python与VBA方法对比

对比维度

Python实现

VBA实现

学习曲线

较陡,需学习Python和pandas

较平缓,Excel用户易上手

运行环境

需安装Python环境和相关库

只需Excel,无需额外安装

处理速度

大数据量时更快,特别是pandas的向量化操作

中等数据量尚可,大数据量较慢

功能扩展

强大,可集成各种数据处理库(numpy、scipy等)

有限,主要依赖Excel对象模型

跨平台

支持Windows、Mac、Linux

主要支持Windows,Mac支持有限

部署难度

需配置环境,可打包成exe

一键分发,但需启用宏

错误处理

异常处理机制完善,可记录详细日志

错误处理相对简单

维护成本

代码结构清晰,易于维护

维护复杂,特别是大型项目

数据处理能力

强大,支持复杂数据清洗、转换、分析

基础数据处理,复杂操作需大量代码

自动化程度

可轻松集成定时任务、API调用等

主要依赖Excel,外部集成有限

4.1 选择建议

选择Python的情况:

  1. 需要处理大量数据(超过10万行)

  2. 需要复杂的数据清洗和转换

  3. 需要与其他系统集成(数据库、API等)

  4. 需要在服务器上定时运行

  5. 需要生成复杂的统计报告

  6. 团队有Python开发能力

选择VBA的情况:

  1. 数据量不大(几万行以内)

  2. 用户主要是Excel熟练用户

  3. 需要快速开发,立即使用

  4. 没有Python环境或无法安装软件

  5. 只需简单合并,不需要复杂处理

  6. 公司IT策略限制外部软件安装

五、高级技巧与最佳实践

5.1 性能优化建议

Python优化:

# 使用chunksize处理大文件chunk_size = 10000chunks = []for chunk in pd.read_excel('large_file.xlsx', chunksize=chunk_size):    chunks.append(chunk)df = pd.concat(chunks, ignore_index=True)# 指定数据类型减少内存占用dtype_dict = {'销售金额''float32''销售数量''int32'}df = pd.read_excel('file.xlsx', dtype=dtype_dict)

VBA优化:

' 1. 禁用屏幕更新Application.ScreenUpdating = False' 2. 禁用自动计算Application.Calculation = xlCalculationManual' 3. 使用数组操作代替单元格操作Dim dataArr As VariantdataArr = sourceWs.Range("A1:Z10000").Value' 处理数组...targetWs.Range("A1").Resize(UBound(dataArr, 1), UBound(dataArr, 2)).Value = dataArr

5.2 错误处理与日志

无论使用哪种方法,良好的错误处理和日志记录都至关重要:

# Python:详细的错误日志import logginglogging.basicConfig(    level=logging.INFO,    format='%(asctime)s - %(levelname)s - %(message)s',    handlers=[        logging.FileHandler('merge_log.log'),        logging.StreamHandler()    ])

5.3 安全性考虑

  1. 文件验证:检查文件是否被篡改

  2. 数据验证:验证数据格式和完整性

  3. 权限控制:确保只有授权用户能访问

  4. 备份机制:合并前备份原始文件

六、选择题

  1. 在Python中使用pandas合并多个DataFrame时,哪个参数可以重置索引?

    A. reset_index=True

    B. ignore_index=True

    C. reindex=True

    D. index_reset=True

  2. 在VBA中,Application.GetOpenFilename方法的哪个参数允许选择多个文件?

    A. AllowMultiSelect=True

    B. MultiSelect=True

    C. MultiSelect:=True

    D. AllowMultiple=True

  3. 使用Python处理大量Excel文件时,哪个方法可以提高内存使用效率?

    A. 使用pandas.read_excel的chunksize参数

    B. 使用glob模块递归查找文件

    C. 使用openpyxl直接写入

    D. 使用csv格式代替Excel

  4. 在VBA中,为了显著提高代码运行速度,通常不应该使用以下哪个设置?

    A. Application.ScreenUpdating = False

    B. Application.Calculation = xlCalculationManual

    C. Application.EnableEvents = False

    D. Application.ScreenUpdating = True

  5. 当需要将Excel合并功能部署到没有Python环境的用户电脑时,最合适的方法是?

    A. 让用户安装Python和pandas

    B. 将Python脚本打包成exe文件

    C. 改用VBA实现

    D. 使用在线工具转换


答案:1-B,2-C,3-A,4-D,5-C

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