当前位置:首页>python>第163讲:构建智能库存管理系统:Python与VBA实战对比

第163讲:构建智能库存管理系统:Python与VBA实战对比

  • 2026-02-05 00:45:20
第163讲:构建智能库存管理系统:Python与VBA实战对比

在企业运营中,库存管理是连接供应链与销售的核心环节。一个高效的库存管理系统能帮助企业降低运营成本提高资金周转率,并确保业务连续稳定运行。本文将深入探讨如何使用Python和VBA分别构建功能完善的库存管理系统。

一、业务背景与库存管理的重要性

库存管理是企业运营的核心环节,直接影响资金周转率客户满意度。传统手工记录方式存在效率低下容易出错数据滞后等问题,无法适应现代企业需求。

据统计,采用自动化库存管理可减少库存成本约20%提高库存周转率约15%,并降低缺货率约30%。一个优秀的库存管理系统应具备实时性准确性预警能力易用性四大特点。

二、VBA方案:基于Excel的轻量级解决方案

对于中小型企业初创团队,使用VBA在Excel中构建库存管理系统是成本效益最高的选择。Excel几乎人人电脑都有,无需额外安装软件,学习曲线平缓。

2.1 基础数据表设计

合理的表结构设计是系统稳定的基础:

Sub InitializeInventoryTables()    ' 创建库存管理系统基础表结构    Dim wsProduct As Worksheet, wsTransaction As Worksheet, wsSummary As Worksheet    ' 删除已存在的工作表    On Error Resume Next    Application.DisplayAlerts = False    ThisWorkbook.Sheets("商品信息").Delete    ThisWorkbook.Sheets("出入库记录").Delete    ThisWorkbook.Sheets("库存汇总").Delete    Application.DisplayAlerts = True    On Error GoTo 0    ' 创建商品信息表    Set wsProduct = ThisWorkbook.Sheets.Add    wsProduct.Name = "商品信息"    wsProduct.Range("A1:E1").Value = Array("商品ID""商品名称""分类""安全库存""最大库存")    ' 创建出入库记录表    Set wsTransaction = ThisWorkbook.Sheets.Add    wsTransaction.Name = "出入库记录"    wsTransaction.Range("A1:G1").Value = Array("流水号""日期""商品ID""类型""数量""单位""备注")    ' 创建库存汇总表    Set wsSummary = ThisWorkbook.Sheets.Add    wsSummary.Name = "库存汇总"    wsSummary.Range("A1:F1").Value = Array("商品ID""商品名称""当前库存""安全库存""状态""最后更新")    ' 设置格式    Call FormatInventoryTables(wsProduct, wsTransaction, wsSummary)    MsgBox "库存管理系统初始化完成!", vbInformationEnd Sub

2.2 核心出入库逻辑实现

自动库存计算与更新是系统的核心功能:

Sub RecordInventoryTransaction(ProductID As String, TransactionType As String, Quantity As Double, Optional Remarks As String = "")    ' 记录出入库交易并自动更新库存    Dim wsTrans As Worksheet, wsProduct As Worksheet, wsSummary As Worksheet    Dim LastRow As Long, CurrentStock As Double, SafetyStock As Double    Set wsTrans = ThisWorkbook.Sheets("出入库记录")    Set wsProduct = ThisWorkbook.Sheets("商品信息")    Set wsSummary = ThisWorkbook.Sheets("库存汇总")    ' 输入验证    If ProductID = "" Or Quantity <= 0 Then        MsgBox "商品ID和数量不能为空且数量必须大于0!", vbExclamation        Exit Sub    End If    ' 检查商品是否存在    If Not CheckProductExists(ProductID) Then        MsgBox "商品ID不存在,请先添加商品!", vbExclamation        Exit Sub    End If    ' 记录交易    LastRow = wsTrans.Cells(wsTrans.Rows.Count, "A").End(xlUp).Row + 1    With wsTrans        .Cells(LastRow, 1).Value = LastRow - 1 ' 流水号        .Cells(LastRow, 2).Value = Now() ' 日期        .Cells(LastRow, 3).Value = ProductID        .Cells(LastRow, 4).Value = TransactionType ' 入库/出库        .Cells(LastRow, 5).Value = Quantity        .Cells(LastRow, 6).Value = GetProductUnit(ProductID)        .Cells(LastRow, 7).Value = Remarks    End With    ' 更新库存汇总    Call UpdateInventorySummary(ProductID, TransactionType, Quantity)    ' 检查库存预警    Call CheckStockAlert(ProductID)    MsgBox TransactionType & "操作完成!", vbInformationEnd Sub

2.3 智能预警功能实现

实时预警机制帮助企业防范风险:

Sub CheckStockAlert(ProductID As String)    ' 检查库存预警条件    Dim wsSummary As Worksheet, ProductRow As Long    Dim CurrentStock As Double, SafetyStock As Double, MaxStock As Double    Set wsSummary = ThisWorkbook.Sheets("库存汇总")    ProductRow = FindProductRow(ProductID)    If ProductRow > 0 Then        CurrentStock = wsSummary.Cells(ProductRow, 3).Value ' 当前库存        SafetyStock = wsSummary.Cells(ProductRow, 4).Value ' 安全库存        ' 清除现有状态        wsSummary.Cells(ProductRow, 5).Interior.ColorIndex = 0        ' 库存预警逻辑        If CurrentStock <= SafetyStock * 0.5 Then            wsSummary.Cells(ProductRow, 5).Value = "紧急缺货"            wsSummary.Cells(ProductRow, 5).Interior.Color = RGB(255, 0, 0) ' 红色            Call SendUrgentAlert(ProductID, CurrentStock)        ElseIf CurrentStock <= SafetyStock Then            wsSummary.Cells(ProductRow, 5).Value = "需补货"            wsSummary.Cells(ProductRow, 5).Interior.Color = RGB(2552550' 黄色        Else            wsSummary.Cells(ProductRow, 5).Value = "正常"            wsSummary.Cells(ProductRow, 5).Interior.Color = RGB(0, 255, 0) ' 绿色        End If    End IfEnd Sub

三、Python方案:基于数据库的专业级解决方案

对于中大型企业或需要多用户协作的场景,Python结合数据库的方案更具扩展性稳定性

3.1 数据库模型设计

使用SQLAlchemy定义数据模型

from sqlalchemy import create_engine, Column, Integer, String, Float, DateTime, Textfrom sqlalchemy.ext.declarative import declarative_basefrom sqlalchemy.orm import sessionmakerfrom datetime import datetimeimport pandas as pdBase = declarative_base()class Product(Base):    """商品信息模型"""    __tablename__ = 'products'    id = Column(Integer, primary_key=True, autoincrement=True)    product_id = Column(String(50), unique=True, nullable=False)    name = Column(String(100), nullable=False)    category = Column(String(50))    unit = Column(String(20))    safety_stock = Column(Integer, default=0)    max_stock = Column(Integer)    current_stock = Column(Integer, default=0)    created_at = Column(DateTime, default=datetime.now)    def __repr__(self):        return f"<Product(id={self.product_id}, name='{self.name}', stock={self.current_stock})>"class InventoryTransaction(Base):    """库存交易记录模型"""    __tablename__ = 'inventory_transactions'    id = Column(Integer, primary_key=True)    product_id = Column(String(50), nullable=False)    transaction_type = Column(String(10), nullable=False)  # IN/OUT    quantity = Column(Integer, nullable=False)    unit = Column(String(20))    transaction_date = Column(DateTime, default=datetime.now)    remarks = Column(Text)    operator = Column(String(50))    def __repr__(self):        return f"<Transaction(product={self.product_id}, type={self.transaction_type}, qty={self.quantity})>"class InventoryManager:    """库存管理器"""    def __init__(self, db_url='sqlite:///inventory.db'):        self.engine = create_engine(db_url)        self.SessionLocal = sessionmaker(bind=self.engine)        self.create_tables()    def create_tables(self):        """创建数据库表"""        Base.metadata.create_all(self.engine)        print("数据库表创建完成!")

3.2 核心业务逻辑实现

完整的库存操作类

class InventoryService:    """库存服务类"""    def __init__(self, session):        self.session = session    def add_product(self, product_data):        """添加新产品"""        try:            product = Product(**product_data)            self.session.add(product)            self.session.commit()            print(f"产品 {product_data['name']} 添加成功!")            return product        except Exception as e:            self.session.rollback()            print(f"添加产品失败: {str(e)}")            raise    def process_transaction(self, product_id, transaction_type, quantity, operator="system", remarks=""):        """处理出入库交易"""        try:            # 验证产品存在性            product = self.session.query(Product).filter_by(product_id=product_id).first()            if not product:                raise ValueError(f"产品 {product_id} 不存在")            # 验证数量            if quantity <= 0:                raise ValueError("数量必须大于0")            # 处理出库校验            if transaction_type.upper() == "OUT" and product.current_stock < quantity:                raise ValueError(f"库存不足!当前库存: {product.current_stock},需求: {quantity}")            # 更新库存            if transaction_type.upper() == "IN":                product.current_stock += quantity            else:  # OUT                product.current_stock -= quantity            # 记录交易            transaction = InventoryTransaction(                product_id=product_id,                transaction_type=transaction_type.upper(),                quantity=quantity,                unit=product.unit,                operator=operator,                remarks=remarks            )            self.session.add(transaction)            self.session.commit()            # 检查库存预警            self.check_stock_alert(product)            print(f"{transaction_type} 操作成功!产品: {product.name},数量: {quantity}")            return transaction        except Exception as e:            self.session.rollback()            print(f"处理交易失败: {str(e)}")            raise

3.3 智能预警与分析系统

高级预警与报表功能

class AdvancedAlertSystem:    """高级预警系统"""    def __init__(self, session):        self.session = session    def check_stock_alert(self, product):        """检查库存预警"""        alert_messages = []        # 低库存预警        if product.current_stock <= product.safety_stock * 0.3:            alert_messages.append({                'level''CRITICAL',                'message'f'产品 {product.name} 库存严重不足!当前: {product.current_stock},安全: {product.safety_stock}',                'product': product.product_id,                'suggested_action''立即补货'            })        elif product.current_stock <= product.safety_stock:            alert_messages.append({                'level''WARNING'                'message'f'产品 {product.name} 库存不足,请及时补货。当前: {product.current_stock}',                'product': product.product_id,                'suggested_action''建议补货'            })        # 高库存预警        if product.max_stock and product.current_stock > product.max_stock * 0.9:            alert_messages.append({                'level''INFO',                'message'f'产品 {product.name} 库存过高,注意周转。当前: {product.current_stock}',                'product': product.product_id,                'suggested_action''控制进货'            })        # 发送预警        for alert in alert_messages:            self.send_alert(alert)        return alert_messages    def generate_daily_report(self):        """生成日报表"""        # 获取当天交易数据        today = datetime.now().date()        transactions = self.session.query(InventoryTransaction).filter(            InventoryTransaction.transaction_date >= today        ).all()        # 计算统计信息        report_data = {            'date': today,            'total_transactions'len(transactions),            'in_count'sum(1 for t in transactions if t.transaction_type == 'IN'),            'out_count'sum(1 for t in transactions if t.transaction_type == 'OUT'),            'alerts'self.get_today_alerts()        }        return report_data    def predict_stockout_risk(self, product_id, days=30):        """预测缺货风险"""        # 获取历史出库数据        transactions = self.session.query(InventoryTransaction).filter(            InventoryTransaction.product_id == product_id,            InventoryTransaction.transaction_type == 'OUT',            InventoryTransaction.transaction_date >= datetime.now() - timedelta(days=90)        ).all()        if not transactions:            return None        # 计算日均出库量        daily_usage = sum(t.quantity for t in transactions) / 90        product = self.session.query(Product).filter_by(product_id=product_id).first()        # 计算预计耗尽天数        if daily_usage > 0:            days_until_stockout = product.current_stock / daily_usage            return {                'product_id': product_id,                'product_name': product.name,                'current_stock': product.current_stock,                'daily_usage': daily_usage,                'days_until_stockout': days_until_stockout,                'risk_level''HIGH' if days_until_stockout < 7 else 'MEDIUM' if days_until_stockout < 30 else 'LOW'            }        return None

四、方案对比与选择指南

4.1 技术特性全面对比

特性维度

VBA方案

Python方案

优势分析

部署成本

⭐⭐⭐⭐⭐(零成本)

⭐⭐⭐(需要环境)

VBA开箱即用

处理能力

⭐⭐(中等数据量)

⭐⭐⭐⭐(大数据量)

Python性能更强

扩展性

⭐⭐(有限扩展)

⭐⭐⭐⭐(生态丰富)

Python可扩展性更强

学习曲线

⭐⭐⭐(相对简单)

⭐⭐(需要基础)

VBA上手更快

跨平台性

⭐(仅Windows)

⭐⭐⭐⭐(全平台)

Python真正跨平台

维护成本

⭐⭐(较高)

⭐⭐⭐(较低)

Python更易维护

4.2 实际应用场景选择指南

选择VBA方案当

  • 企业规模小:数据量不超过万行

  • 技术基础弱:团队熟悉Office但不熟悉编程

  • 预算有限无法承担额外软件成本

  • 快速上线:需要立即投入使用的解决方案

选择Python方案当

  • 数据量大:需要处理超过10万行数据

  • 复杂逻辑:需要高级预警预测分析

  • 系统集成:需要与其他系统进行集成

  • 长期发展:系统需要持续迭代功能扩展

五、实战案例:企业级库存管理系统实现

5.1 业务背景与挑战

某中型电商企业日均处理500+出入库记录,传统手工方式面临挑战:库存不准导致超卖缺货效率低下影响发货速度预警缺失造成资金占用过高

5.2 基于Python的完整解决方案

企业级库存管理平台

class EnterpriseInventorySystem:    """企业级库存管理系统"""    def __init__(self, db_url, config=None):        self.config = config or self.default_config()        self.manager = InventoryManager(db_url)        self.session = self.manager.SessionLocal()        self.inventory_service = InventoryService(self.session)        self.alert_system = AdvancedAlertSystem(self.session)        self.setup_logging()    def default_config(self):        """默认配置"""        return {            'low_stock_threshold'0.3,  # 低库存阈值(安全库存的30%)            'high_stock_threshold'0.9,  # 高库存阈值(最大库存的90%)            'alert_methods': ['email''dashboard'],  # 预警方式            'backup_days'30  # 数据备份天数        }    def process_bulk_transactions(self, transactions_data):        """批量处理交易"""        success_count = 0        failure_count = 0        results = []        for transaction in transactions_data:            try:                result = self.inventory_service.process_transaction(**transaction)                results.append({'status''success''data': result})                success_count += 1            except Exception as e:                results.append({'status''error''error'str(e)})                failure_count += 1        # 生成处理报告        report = self.generate_batch_report(success_count, failure_count, results)        return {            'success_count': success_count,            'failure_count': failure_count,            'results': results,            'report': report        }    def generate_dashboard_data(self):        """生成仪表板数据"""        # 库存概览        inventory_overview = self.get_inventory_overview()        # 预警信息        alerts = self.get_active_alerts()        # 近期交易统计        transaction_stats = self.get_transaction_stats()        # 缺货风险预测        stockout_risks = self.get_stockout_risks()        return {            'inventory_overview': inventory_overview,            'alerts': alerts,            'transaction_stats': transaction_stats,            'stockout_risks': stockout_risks,            'last_updated': datetime.now()        }# 使用示例def enterprise_system_demo():    """企业级系统演示"""    system = EnterpriseInventorySystem('sqlite:///enterprise_inventory.db')    # 批量添加产品    products = [        {'product_id''P001''name''商品A''category''电子''safety_stock'50'max_stock'200},        {'product_id''P002''name''商品B''category''家居''safety_stock'30'max_stock'100}    ]    for product in products:        system.inventory_service.add_product(product)    # 批量处理交易    transactions = [        {'product_id''P001''transaction_type''IN''quantity'100'operator''user1'},        {'product_id''P002''transaction_type''IN''quantity'50'operator''user1'}    ]    result = system.process_bulk_transactions(transactions)    print(f"批量处理完成:成功 {result['success_count']} 条,失败 {result['failure_count']} 条")    return systemif __name__ == "__main__":    enterprise_system_demo()

测试题

  1. 在VBA库存管理系统中,如何避免在多用户同时操作时出现数据冲突问题?请说明具体实现方法。

  2. Python的SQLAlchemy ORM相比直接使用SQL语句在库存管理系统开发中有哪些优势?在什么场景下可能不适合使用ORM?

  3. 当需要处理大量并发库存操作时,Python方案应该如何设计数据库事务来确保数据一致性?

  4. 在VBA方案中,如何实现自动库存预警邮件的发送功能?请写出关键代码实现。

  5. 请设计一个混合架构方案,利用VBA作为前端数据录入界面,通过Python后端进行数据处理和预警,并说明这种架构的数据交换机制。


答案

  1. VBA多用户冲突解决:使用文件打开状态检测操作前检查文件是否被锁定实现重试机制关键操作区加锁设置操作排队机制。可通过Workbook.WriteReserved属性检测文件状态。

  2. SQLAlchemy ORM优势开发效率高代码可读性好数据库无关性自动防SQL注入。不适合复杂报表查询高性能批量操作场景,此时直接SQL更高效。

  3. Python高并发事务设计:使用数据库事务隔离级别悲观锁/乐观锁控制操作队列序列化短事务原则。SQLAlchemy可通过with session.begin():管理事务边界。

  4. VBA邮件预警实现:使用Outlook对象模型,通过CreateObject("Outlook.Application")创建邮件项,设置收件人、主题、正文后调用.Send方法发送。需处理邮件客户端依赖安全设置

  5. 混合架构设计VBA前端负责数据收集和界面交互,Python后端通过Flask/FastAPI提供REST接口,使用JSON格式进行数据交换,定时同步确保数据一致性。


希望这篇详细的库存管理系统指南能帮助您提升企业库存管理水平!如果觉得本文有帮助,请点赞、收藏、转发支持一下!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-07 12:18:06 HTTP/2.0 GET : https://f.mffb.com.cn/a/471428.html
  2. 运行时间 : 0.299141s [ 吞吐率:3.34req/s ] 内存消耗:4,601.50kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=7c2814e940ddc0ed95fdc9436f094bb8
  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.001132s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001546s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.001087s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000687s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001414s ]
  6. SELECT * FROM `set` [ RunTime:0.046016s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.002087s ]
  8. SELECT * FROM `article` WHERE `id` = 471428 LIMIT 1 [ RunTime:0.007100s ]
  9. UPDATE `article` SET `lasttime` = 1770437886 WHERE `id` = 471428 [ RunTime:0.009333s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000747s ]
  11. SELECT * FROM `article` WHERE `id` < 471428 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.002205s ]
  12. SELECT * FROM `article` WHERE `id` > 471428 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001145s ]
  13. SELECT * FROM `article` WHERE `id` < 471428 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.021876s ]
  14. SELECT * FROM `article` WHERE `id` < 471428 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.016114s ]
  15. SELECT * FROM `article` WHERE `id` < 471428 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002728s ]
0.302989s