当前位置:首页>python>Python AI Agent 零基础教程 | 第9篇:实战项目——构建智能客服Agent

Python AI Agent 零基础教程 | 第9篇:实战项目——构建智能客服Agent

  • 2026-07-01 16:03:54
Python AI Agent 零基础教程 | 第9篇:实战项目——构建智能客服Agent
   

Python AI Agent 零基础教程 | 第9篇:实战项目——构建智能客服Agent


前言

经过前 8 期的学习,我们已经掌握了 AI Agent 的核心技能。今天我们将综合运用这些知识,从零构建一个完整的智能客服系统! 这个客服 Agent 将能够: - 🤖 自动回答常见问题 - 📦 查询订单状态 - 💡 推荐产品 - 📝 收集用户反馈


一、项目需求分析
1.1 客服场景描述

我们为一家「优品数码专营店」构建智能客服:

Python 代码
┌─────────────────────────────────────────────────────────────┐
│                   优品数码专营店 智能客服                     │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  🏪 店铺信息:                                               │
│     - 营业时间:9:00 - 22:00                                 │
│     - 退换货政策:7天无理由退换                               │
│     - 快递说明:全场包邮,48小时内发货                        │
│                                                             │
│  📋 主要业务:                                               │
│     - 商品咨询                                               │
│     - 订单查询                                               │
│     - 退换货处理                                             │
│     - 售后问题                                               │
│                                                             │
│  💡 核心功能:                                               │
│     - 自动问答                                               │
│     - 订单管理                                               │
│     - 投诉建议                                               │
│     - 转人工服务                                             │
│                                                             │
└─────────────────────────────────────────────────────────────┘
1.2 功能模块
模块功能优先级
基础问答回答常见问题⭐⭐⭐ 高
订单查询查单、改地址、取消⭐⭐⭐ 高
商品推荐根据需求推荐产品⭐⭐ 中
投诉处理记录投诉、跟进⭐⭐ 中
转人工无法解答时转人工⭐⭐⭐ 高

---

二、系统架构设计
2.1 整体架构
Python 代码
┌─────────────────────────────────────────────────────────────┐
│                    智能客服系统架构                          │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│    用户 ──▶ 接入层                                          │
│               │                                             │
│               ▼                                             │
│    ┌────────────────────────────────────────────┐          │
│    │              意图识别层                     │          │
│    │  ┌─────────┐ ┌─────────┐ ┌─────────┐     │          │
│    │  │ 问答    │ │ 订单    │ │ 转人工  │     │          │
│    │  │ 意图    │ │ 意图    │ │ 意图    │     │          │
│    │  └────┬────┘ └────┬────┘ └────┬────┘     │          │
│    └───────┼──────────┼──────────┼────────────┘          │
│            │          │          │                       │
│            ▼          ▼          ▼                       │
│    ┌────────────────────────────────────────────┐          │
│    │              知识库层                       │          │
│    │  ┌────────┐ ┌────────┐ ┌────────┐        │          │
│    │  │ FAQ    │ │ 订单   │ │ 商品   │        │          │
│    │  │ 知识库 │ │ 数据库 │ │ 数据库 │        │          │
│    │  └────────┘ └────────┘ └────────┘        │          │
│    └────────────────────────────────────────────┘          │
│               │                                             │
│               ▼                                             │
│            返回结果                                          │
│                                                             │
└─────────────────────────────────────────────────────────────┘
2.2 核心组件
Python 代码
系统组件概览
COMPONENTS = {
    "意图识别": "识别用户想做什么(查单/咨询/投诉/转人工)",
    "知识库": "存储常见问题和答案",
    "订单系统": "模拟订单查询和管理",
    "对话管理": "管理对话流程和状态",
    "响应生成": "生成自然语言回复"
}

三、数据模型设计
3.1 知识库数据
Python 代码
FAQ 知识库
FAQ_KNOWLEDGE = {
    "配送问题": [
        {
            "question": ["什么时候发货", "几天到", "快递", "物流"],
            "answer": "您好!我们全场包邮,48小时内发货。正常情况下2-5天可达,具体以物流信息为准。"
        },
        {
            "question": ["可以改地址吗", "修改地址"],
            "answer": "您好!订单未发货前可以修改地址。请提供订单号,我来帮您处理。"
        }
    ],
    "退换货": [
        {
            "question": ["怎么退货", "可以退吗", "退换货"],
            "answer": "您好!我们支持7天无理由退换货(不影响二次销售)。请提供订单号,我会帮您申请。"
        }
    ],
    "支付问题": [
        {
            "question": ["支持哪些支付", "怎么付款", "支付方式"],
            "answer": "您好!我们支持支付宝、微信支付、银行卡支付等多种方式。"
        }
    ]
}

商品数据
PRODUCTS = [
    {"id": "P001", "name": "iPhone 15 Pro", "price": 7999, "category": "手机", "stock": 100},
    {"id": "P002", "name": "MacBook Pro 14", "price": 14999, "category": "电脑", "stock": 50},
    {"id": "P003", "name": "AirPods Pro 2", "price": 1899, "category": "耳机", "stock": 200},
    {"id": "P004", "name": "iPad Air", "price": 4799, "category": "平板", "stock": 80},
]

订单数据(模拟)
ORDERS = [
    {"order_id": "ORD20240101001", "product": "iPhone 15 Pro", "status": "配送中", "address": "北京市朝阳区", "phone": "138**1234"},
    {"order_id": "ORD20240101002", "product": "AirPods Pro 2", "status": "已签收", "address": "上海市浦东新区", "phone": "139**5678"},
    {"order_id": "ORD20240101003", "product": "MacBook Pro 14", "status": "待发货", "address": "广州市天河区", "phone": "137**9012"},
]
3.2 对话状态
Python 代码
class ConversationState:
    """对话状态"""
    
    def __init__(self, session_id):
        self.session_id = session_id
        self.intent = None  # 当前意图
        self.context = {}   # 上下文信息
        self.waiting_for = None  # 等待用户输入什么
        self.history = []   # 对话历史
    
    def set_intent(self, intent):
        """设置意图"""
        self.intent = intent
        self.context = {}
    
    def add_context(self, key, value):
        """添加上下文"""
        self.context[key] = value
    
    def set_waiting(self, field):
        """设置等待输入"""
        self.waiting_for = field
    
    def clear(self):
        """清除状态"""
        self.intent = None
        self.context = {}
        self.waiting_for = None

四、核心代码实现
4.1 知识库问答
Python 代码
class KnowledgeBase:
    """知识库"""
    
    def __init__(self):
        self.faq = self._load_faq()
    
    def _load_faq(self):
        """加载 FAQ"""
        return {
            "配送": "您好!我们全场包邮,48小时内发货。正常2-5天可达。",
            "退货": "您好!我们支持7天无理由退换货,请提供订单号申请。",
            "支付": "您好!我们支持支付宝、微信、银行卡支付。",
            "保修": "您好!正品保障,提供官方保修服务。",
            "发票": "您好!可以开具电子发票,请联系客服提供开票信息。",
            "优惠": "您好!我们经常有优惠活动,关注店铺享更多福利!",
            "店铺": "您好!我们是优品数码专营店,正品保障,服务至上!",
            "营业": "您好!我们的营业时间是每天9:00-22:00。"
        }
    
    def search(self, query):
        """搜索答案"""
        query = query.lower()
        
        # 关键词匹配
        for keyword, answer in self.faq.items():
            if keyword in query:
                return answer
        
        return None
    
    def get_greeting(self):
        """问候语"""
        return """👋 您好!欢迎来到优品数码专营店!

我是您的智能客服小e,请问有什么可以帮您?

📦 您可以咨询:
• 配送物流问题
• 退换货流程
• 产品推荐
• 订单查询

或者直接告诉我您的需求哦~"""

    def get_goodbye(self):
        """结束语"""
        return """感谢您的咨询,祝您购物愉快!🛒

如有其他问题,随时联系我~

📞 人工客服热线:400-888-8888
⏰ 营业时间:9:00-22:00"""
4.2 订单管理
Python 代码
class OrderManager:
    """订单管理器"""
    
    def __init__(self):
        # 模拟订单数据
        self.orders = {
            "ORD20240101001": {
                "product": "iPhone 15 Pro 256G 钛金色",
                "status": "配送中",
                "address": "北京市朝阳区XX路XX号",
                "phone": "138**1234",
                "create_time": "2024-01-01 10:30",
                "delivery_time": "预计2-3天送达"
            },
            "ORD20240101002": {
                "product": "AirPods Pro 2",
                "status": "已签收",
                "address": "上海市浦东新区XX路XX号",
                "phone": "139**5678",
                "create_time": "2023-12-28 15:20",
                "delivery_time": "已签收"
            },
            "ORD20240101003": {
                "product": "MacBook Pro 14寸",
                "status": "待发货",
                "address": "广州市天河区XX路XX号",
                "phone": "137**9012",
                "create_time": "2024-01-02 09:15",
                "delivery_time": "48小时内发货"
            }
        }
    
    def query_by_order_id(self, order_id):
        """按订单号查询"""
        order_id = order_id.upper().strip()
        if order_id in self.orders:
            return self.orders[order_id]
        return None
    
    def query_by_phone(self, phone):
        """按手机号查询"""
        results = []
        for oid, order in self.orders.items():
            if phone in order["phone"]:
                results.append((oid, order))
        return results
    
    def format_order(self, order_id, order):
        """格式化订单信息"""
        return f"""
📦 订单号:{order_id}
🛍️ 商品:{order['product']}
📍 地址:{order['address']}
📱 联系方式:{order['phone']}
🚚 状态:{order['status']}
⏰ {order['delivery_time']}
"""
    
    def modify_address(self, order_id, new_address):
        """修改地址"""
        if order_id in self.orders:
            self.orders[order_id]["address"] = new_address
            return True
        return False
4.3 产品推荐
Python 代码
class ProductRecommender:
    """产品推荐"""
    
    def __init__(self):
        self.products = [
            {"name": "iPhone 15 Pro", "price": 7999, "tags": ["手机", "高端", "苹果"]},
            {"name": "iPhone 15", "price": 5999, "tags": ["手机", "性价比", "苹果"]},
            {"name": "MacBook Pro 14", "price": 14999, "tags": ["电脑", "高端", "苹果"]},
            {"name": "MacBook Air", "price": 8999, "tags": ["电脑", "轻薄", "苹果"]},
            {"name": "AirPods Pro 2", "price": 1899, "tags": ["耳机", "降噪", "苹果"]},
            {"name": "AirPods 3", "price": 1399, "tags": ["耳机", "入门", "苹果"]},
            {"name": "iPad Pro", "price": 6999, "tags": ["平板", "高端", "苹果"]},
            {"name": "iPad Air", "price": 4799, "tags": ["平板", "性价比", "苹果"]},
            {"name": "Apple Watch", "price": 2999, "tags": ["手表", "健康", "苹果"]},
        ]
    
    def recommend(self, budget=None, category=None):
        """推荐产品"""
        results = self.products
        
        # 按类别筛选
        if category:
            results = [p for p in results if category in p["tags"]]
        
        # 按预算筛选
        if budget:
            if isinstance(budget, tuple):
                results = [p for p in results if budget[0] <= p["price"] <= budget[1]]
            else:
                results = [p for p in results if p["price"] <= budget]
        
        # 格式化输出
        if not results:
            return "抱歉,暂未找到符合条件的产品"
        
        response = "根据您的需求,为您推荐:\n\n"
        for i, p in enumerate(results[:5], 1):
            response += f"{i}. {p['name']} - ¥{p['price']}\n"
        
        return response
    
    def search(self, keyword):
        """搜索产品"""
        results = [p for p in self.products if keyword.lower() in p["name"].lower()]
        
        if not results:
            return f"抱歉,未找到「{keyword}」相关产品"
        
        response = f"为您找到 {len(results)} 个相关产品:\n\n"
        for p in results:
            response += f"📱 {p['name']}\n   价格:¥{p['price']}\n   标签:{' '.join(p['tags'])}\n\n"
        
        return response

五、智能客服 Agent
5.1 完整 Agent 代码
Python 代码
import requests
import json
import re

class CustomerServiceAgent:
    """智能客服 Agent"""
    
    def __init__(self, api_key):
        self.api_key = api_key
        self.knowledge_base = KnowledgeBase()
        self.order_manager = OrderManager()
        self.product_recommender = ProductRecommender()
        
        self.messages = []
        self.conversation_state = None
        
        # 系统提示词
        self.system_prompt = """你是一个专业的电商客服,名字叫小e,服务于「优品数码专营店」。

【店铺信息】
- 营业时间:9:00-22:00
- 退换货政策:7天无理由退换
- 快递说明:全场包邮,48小时内发货

【服务原则】
  1. 保持礼貌和耐心
  2. 回答专业、准确
  3. 无法解答时转人工
  4. 结束时询问是否还有其他问题
【回复格式】 - 使用 emoji 增加亲切感 - 回答简洁明了 - 必要时分点说明 【转人工条件】 - 涉及投诉处理 - 需要人工确认的重要事项 - 连续3次无法理解用户意图""" def reset(self): """重置对话""" self.messages = [{"role": "system", "content": self.system_prompt}] self.conversation_state = None def think(self, user_input): """处理用户输入""" # 检查是否需要转人工 if "转人工" in user_input or "人工客服" in user_input: return self._transfer_to_human() # 先尝试知识库匹配 kb_answer = self.knowledge_base.search(user_input) if kb_answer: return kb_answer # 检查是否包含订单号 order_id = self._extract_order_id(user_input) if order_id: return self._handle_order_query(order_id) # 检查是否需要产品推荐 if any(kw in user_input for kw in ["推荐", "想要", "想买", "有什么"]): category = self._extract_category(user_input) budget = self._extract_budget(user_input) return self.product_recommender.recommend(budget, category) # 检查是否是产品搜索 if "有" in user_input and ("吗" in user_input or "卖" in user_input): keyword = self._extract_product_keyword(user_input) if keyword: return self.product_recommender.search(keyword) # 使用 AI 生成回复 return self._generate_response(user_input) def _extract_order_id(self, text): """提取订单号""" pattern = r'ORD\d{12}' match = re.search(pattern, text.upper()) return match.group(0) if match else None def _extract_category(self, text): """提取商品类别""" categories = ["手机", "电脑", "平板", "耳机", "手表"] for cat in categories: if cat in text: return cat return None def _extract_budget(self, text): """提取预算""" # 简化处理 if "预算" in text: numbers = re.findall(r'\d+', text) if numbers: return int(numbers[0]) return None def _extract_product_keyword(self, text): """提取产品关键词""" # 去除问号和语气词 text = text.replace("吗", "").replace("有", "").replace("卖", "").replace("?", "").strip() if text: return text return None def _handle_order_query(self, order_id): """处理订单查询""" order = self.order_manager.query_by_order_id(order_id) if order: return f"为您查询到订单信息:\n{self.order_manager.format_order(order_id, order)}" return f"未找到订单 {order_id},请核对订单号是否正确。" def _transfer_to_human(self): """转人工""" return """🤝 正在为您转接人工客服... 请稍候,人工客服将尽快为您服务。 如有紧急问题,可拨打客服热线:📞 400-888-8888 ⏰ 人工服务时间:9:00-22:00""" def _generate_response(self, user_input): """使用 AI 生成回复""" self.messages.append({"role": "user", "content": user_input}) # 构建 prompt context = "" if self.conversation_state and self.conversation_state.context: context = f"\n当前上下文:{self.conversation_state.context}" # 调用 API response = self._call_api(context) self.messages.append({"role": "assistant", "content": response}) return response def _call_api(self, context=""): """调用 API""" url = "https://api.openai.com/v1/chat/completions" headers = { "Content-Type": "application/json", "Authorization": f"Bearer {self.api_key}" } # 添加上下文到系统提示 messages = [{"role": "system", "content": self.system_prompt + context}] messages.extend(self.messages[-6:]) # 只保留最近几条 data = { "model": "gpt-3.5-turbo", "messages": messages, "temperature": 0.7 } try: response = requests.post(url, headers=headers, json=data, timeout=30) result = response.json() return result["choices"][0]["message"]["content"] except Exception as e: return f"抱歉,系统暂时繁忙,请稍后再试。错误:{str(e)}" def run(self): """运行客服""" print("="*60) print("🏪 优品数码专营店 智能客服") print("="*60) print(self.knowledge_base.get_greeting()) print("\n(输入 'quit' 退出,'reset' 重置对话)") print("="*60) while True: try: user_input = input("\n👤 您:").strip() if not user_input: continue if user_input.lower() == "quit": print("\n" + self.knowledge_base.get_goodbye()) break elif user_input.lower() == "reset": self.reset() print("\n✅ 对话已重置") print(self.knowledge_base.get_greeting()) else: response = self.think(user_input) print(f"\n🤖 小e:{response}") except KeyboardInterrupt: print("\n\n感谢使用,再见!") break
5.2 运行效果
Python 代码
============================================================
🏪 优品数码专营店 智能客服
============================================================
👋 您好!欢迎来到优品数码专营店!

我是您的智能客服小e,请问有什么可以帮您?

📦 您可以咨询:
• 配送物流问题
• 退换货流程
• 产品推荐
• 订单查询

或者直接告诉我您的需求哦~

(输入 'quit' 退出,'reset' 重置对话)
============================================================

👤 您:你们的发货时间是几点?

🤖 小e:您好!我们全场包邮,48小时内发货。正常情况下2-5天可达,具体以物流信息为准。

👤 您:ORD20240101001 这个订单到哪了?

🤖 小e:为您查询到订单信息:

📦 订单号:ORD20240101001
🛍️ 商品:iPhone 15 Pro 256G 钛金色
📍 地址:北京市朝阳区XX路XX号
📱 联系方式:138**1234
🚚 状态:配送中
⏰ 预计2-3天送达

👤 您:我想买一个平板,预算5000左右

🤖 小e:根据您的需求,为您推荐:

  1. iPad Air - ¥4799
  2. iPad Pro - ¥6999
👤 您:quit 感谢您的咨询,祝您购物愉快!🛒 如有其他问题,随时联系我~ 📞 人工客服热线:400-888-8888 ⏰ 营业时间:9:00-22:00

六、部署与扩展
6.1 Web 接口部署
Python 代码
from flask import Flask, request, jsonify

app = Flask(__name__)
agent = CustomerServiceAgent("your-api-key")

@app.route("/chat", methods=["POST"])
def chat():
    """对话接口"""
    data = request.json
    user_input = data.get("message", "")
    
    if not user_input:
        return jsonify({"error": "请输入消息"})
    
    response = agent.think(user_input)
    
    return jsonify({
        "code": 0,
        "message": "success",
        "data": {
            "reply": response
        }
    })

@app.route("/reset", methods=["POST"])
def reset():
    """重置对话"""
    agent.reset()
    return jsonify({"code": 0, "message": "success"})

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=5000)
6.2 微信小程序接入
Python 代码
微信公众号自动回复示例
@app.route("/wechat", methods=["GET", "POST"])
def wechat():
    if request.method == "GET":
        # 验证微信服务器
        return request.args.get("echostr", "")
    
    # 处理消息
    xml_data = request.data
    # 解析并处理...
    
    # 调用 Agent
    reply = agent.think(user_message)
    
    # 返回回复
    return render_template("reply.xml", reply=reply)

七、本章小结

今天我们构建了:

模块功能
✅ 知识库FAQ 问答、关键词匹配
✅ 订单管理订单查询、状态跟踪
✅ 产品推荐按类别、预算推荐
✅ 智能 Agent意图识别、自动分流
✅ Web 接口API 部署方案

---

下期预告
第10篇:调试优化与常见问题解决

最后一期我们将学习:

 - 常见错误排查

 - 性能优化技巧

 - 安全性考虑

 - 进阶学习路径


👨‍💻 作者:鹏鹏 | 专注于 AI + 编程教育 
 📱 关注公众号「跟着鹏鹏学技术」
 💬 动手练习:运行客服系统,测试各种功能!

往期精选

- 📖 [第8篇:工具调用]() - 📖 [第7篇:记忆系统]() - 📖 [第6篇:提示词工程]()


   

👨‍💻 作者:鹏鹏

   

📱 关注公众号「跟着鹏鹏学技术」

   

🔔 点赞 + 在看,让更多人看到!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 02:46:57 HTTP/2.0 GET : https://f.mffb.com.cn/a/489325.html
  2. 运行时间 : 0.124835s [ 吞吐率:8.01req/s ] 内存消耗:4,289.13kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=f346b194d0f0df481565aa591acc06bb
  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.000579s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000824s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000355s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000259s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000515s ]
  6. SELECT * FROM `set` [ RunTime:0.000208s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000580s ]
  8. SELECT * FROM `article` WHERE `id` = 489325 LIMIT 1 [ RunTime:0.000522s ]
  9. UPDATE `article` SET `lasttime` = 1783104417 WHERE `id` = 489325 [ RunTime:0.014539s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.003195s ]
  11. SELECT * FROM `article` WHERE `id` < 489325 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.003811s ]
  12. SELECT * FROM `article` WHERE `id` > 489325 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.007346s ]
  13. SELECT * FROM `article` WHERE `id` < 489325 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.009992s ]
  14. SELECT * FROM `article` WHERE `id` < 489325 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.003227s ]
  15. SELECT * FROM `article` WHERE `id` < 489325 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.006367s ]
0.127413s