当前位置:首页>python>Python教程- 项目实战:从零搭建数据分析 Dashboard

Python教程- 项目实战:从零搭建数据分析 Dashboard

  • 2026-08-19 11:15:53
Python教程- 项目实战:从零搭建数据分析 Dashboard

欢迎来到第十期,也是本系列的第一阶段的收官之作!

到这里,你已经掌握了:

- Episode 01-04:Python 基础(语法、数据结构、OOP、装饰器/生成器)

- Episode 05:爬虫入门

- Episode 06:数据分析(NumPy / Pandas / Matplotlib)

- Episode 07:Web 后端开发(FastAPI + RESTful API)

- Episode 08:AI 实战(LangChain + RAG)

- Episode 09:前端入门(React + 调用 API)

**但知识如果不串联起来,就只是散落的珍珠。** 本期的目标就是把所有珍珠串成一条项链——**从零搭建一个完整的数据分析 Dashboard 项目**

>**前置知识**:需要熟悉本系列前面 9 期的内容。这个项目将综合运用所有知识点。

---

## 10.1 项目概述

我们要做一个名为 **"FinanceFlow"** 的个人财务管理 Dashboard。

### 功能清单

```

✅ 数据录入:支持添加收入/支出记录(分类、金额、备注、日期)

✅ 数据查询:按时间、分类、类型筛选和分页

✅ 数据可视化:

   - 月度收支趋势折线图

   - 分类占比饼图

   - 每日/每周/每月切换视图

   - 余额变化曲线

✅ AI 智能分析:输入自然语言,AI 生成分析报告

✅ 数据导出:支持导出 CSV / PDF 报告

✅ 响应式设计:桌面端和移动端均可使用

```

### 技术栈

```

前端:React + Vite + Chart.js

后端:FastAPI + SQLite

AI:LangChain + RAG

部署:本地开发 → 一键部署到云服务器

```

---

## 10.2 第一步:搭建后端(FastAPI + SQLite)

### 10.2.1 项目结构

```

financeflow/

├── backend/

│   ├── main.py            # FastAPI 入口

│   ├── models.py          # Pydantic 数据模型

│   ├── database.py        # 数据库连接与管理

│   ├── crud.py            # 增删改查操作

│   └── ai.py              # AI 分析接口

├── frontend/

│   └── ...                # React 项目

└── knowledge-base/        # AI 知识库文档

    └── finance_guide.md

```

### 10.2.2 数据库模型

```python

# backend/database.py

import sqlite3

from datetime import date

from pathlib import Path

DB_PATH = Path(__file__).parent / "financeflow.db"

defget_connection():

"""获取数据库连接"""

    conn = sqlite3.connect(DB_PATH)

    conn.execute("PRAGMA journal_mode=WAL")  # 提高并发性能

    conn.row_factory = sqlite3.Row

return conn

definit_db():

"""初始化数据库表"""

    conn = get_connection()

with conn:

        conn.executescript("""

            -- 交易记录表

            CREATE TABLE IF NOT EXISTS transactions (

                id INTEGER PRIMARY KEY AUTOINCREMENT,

                amount REAL NOT NULL CHECK(amount > 0),

                type TEXT NOT NULL CHECK(type IN ('收入', '支出')),

                category TEXT NOT NULL,

                subcategory TEXT DEFAULT '',

                note TEXT DEFAULT '',

                transaction_date DATE NOT NULL DEFAULT CURRENT_DATE,

                created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,

                updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP

            );

            -- 分类配置表

            CREATE TABLE IF NOT EXISTS categories (

                id INTEGER PRIMARY KEY AUTOINCREMENT,

                name TEXT NOT NULL UNIQUE,

                type TEXT NOT NULL CHECK(type IN ('收入', '支出')),

                color TEXT DEFAULT '#4caf50',

                icon TEXT DEFAULT '📦',

                parent_id INTEGER DEFAULT NULL

            );

            -- 初始化预设分类

            INSERT OR IGNORE INTO categories (name, type, color, icon) VALUES

                ('工资', '收入', '#4caf50', '💼'),

                ('奖金', '收入', '#66bb6a', '🎁'),

                ('投资收益', '收入', '#81c784', '📈'),

                ('副业收入', '收入', '#a5d6a7', '💻'),

                ('餐饮', '支出', '#ef5350', '🍜'),

                ('交通', '支出', '#ff7043', '🚗'),

                ('购物', '支出', '#ff8a65', '🛒'),

                ('住房', '支出', '#ffa726', '🏠'),

                ('娱乐', '支出', '#ffb74d', '🎮'),

                ('医疗', '支出', '#ffca28', '💊'),

                ('教育', '支出', '#fff176', '📚'),

                ('通讯', '支出', '#aed581', '📱');

        """)

    conn.close()

# 运行时初始化

init_db()

```

### 10.2.3 CRUD 操作层

```python

# backend/crud.py

from database import get_connection

from datetime import date

defadd_transaction(amountfloattx_typestrcategorystr,

subcategorystr = ""notestr = ""tx_datestr = None) -> int:

"""添加交易记录"""

    conn = get_connection()

with conn:

        cursor = conn.execute(

"""INSERT INTO transactions (amount, type, category, subcategory, note, transaction_date)

               VALUES (?, ?, ?, ?, ?, COALESCE(?, DATE('now')))""",

            (amount, tx_type, category, subcategory, note, tx_date)

        )

        conn.commit()

return cursor.lastrowid

defget_transactions(tx_typestr = Nonecategorystr = None,

start_datestr = Noneend_datestr = None,

limitint = 50offsetint = 0) -> dict:

"""获取交易记录(支持筛选和分页)"""

    conn = get_connection()

    query = "SELECT * FROM transactions WHERE 1=1"

    params = []

if tx_type:

        query += " AND type = ?"

        params.append(tx_type)

if category:

        query += " AND category = ?"

        params.append(category)

if start_date:

        query += " AND transaction_date >= ?"

        params.append(start_date)

if end_date:

        query += " AND transaction_date <= ?"

        params.append(end_date)

    query += " ORDER BY transaction_date DESC LIMIT ? OFFSET ?"

    params.extend([limit, offset])

    rows = conn.execute(query, params).fetchall()

    transactions = [dict(row) for row in rows]

# 获取总数

    count_query = "SELECT COUNT(*) FROM transactions WHERE 1=1"

    count_params = []

if tx_type:

        count_query += " AND type = ?"

        count_params.append(tx_type)

if category:

        count_query += " AND category = ?"

        count_params.append(category)

if start_date:

        count_query += " AND transaction_date >= ?"

        count_params.append(start_date)

if end_date:

        count_query += " AND transaction_date <= ?"

        count_params.append(end_date)

    total = conn.execute(count_query, count_params).fetchone()[0]

return {

"transactions": transactions,

"total": total,

"limit": limit,

"offset": offset,

"pages": (total + limit - 1) // limit if total > 0else1

    }

defget_monthly_summary(yearintmonthint) -> dict:

"""获取月度统计"""

    conn = get_connection()

    prefix = f"{year}-{month:02d}-"

    income = conn.execute(

"SELECT COALESCE(SUM(amount), 0) FROM transactions WHERE type='收入' AND transaction_date LIKE ?",

        (prefix + "%",)

    ).fetchone()[0]

    expense = conn.execute(

"SELECT COALESCE(SUM(amount), 0) FROM transactions WHERE type='支出' AND transaction_date LIKE ?",

        (prefix + "%",)

    ).fetchone()[0]

# 按分类统计支出

    category_breakdown = conn.execute(

"""SELECT category, SUM(amount) as total 

           FROM transactions 

           WHERE type='支出' AND transaction_date LIKE ?

           GROUP BY category ORDER BY total DESC""",

        (prefix + "%",)

    ).fetchall()

return {

"year": year,

"month": month,

"income"round(income, 2),

"expense"round(expense, 2),

"balance"round(income - expense, 2),

"category_breakdown": [dict(row) for row in category_breakdown]

    }

defget_daily_trend(daysint = 30) -> dict:

"""获取每日趋势(用于折线图)"""

    conn = get_connection()

# 获取近 N 天的数据

    rows = conn.execute(

"""SELECT transaction_date,

                  SUM(CASE WHEN type='收入' THEN amount ELSE 0 END) as daily_income,

                  SUM(CASE WHEN type='支出' THEN amount ELSE 0 END) as daily_expense

           FROM transactions

           WHERE transaction_date >= DATE('now', ? || ' days')

           GROUP BY transaction_date

           ORDER BY transaction_date""",

        (f"-{days}",)

    ).fetchall()

return {

"dates": [row["transaction_date"for row in rows],

"income": [round(row["daily_income"], 2for row in rows],

"expense": [round(row["daily_expense"], 2for row in rows]

    }

```

### 10.2.4 FastAPI 路由层

```python

# backend/main.py

from fastapi import FastAPI, HTTPException, Query

from fastapi.middleware.cors import CORSMiddleware

from pydantic import BaseModel, Field

from typing import Optional

from crud import add_transaction, get_transactions, get_monthly_summary, get_daily_trend

app = FastAPI(

title="FinanceFlow API",

description="个人财务管理 Dashboard 后端服务",

version="1.0.0"

)

# 开启 CORS

app.add_middleware(

    CORSMiddleware,

allow_origins=["http://localhost:5173"],

allow_credentials=True,

allow_methods=["*"],

allow_headers=["*"],

)

# ============ 数据模型 ============

classTransactionCreate(BaseModel):

    amount: float = Field(...gt=0description="金额")

typestr = Field(...pattern="^(收入|支出)$"description="类型:收入 或 支出")

    category: str = Field(...description="分类")

    subcategory: str = "",

    note: str = Field(""max_length=200),

    transaction_date: str = ""

# ============ API 路由 ============

@app.post("/api/transactions"status_code=201)

defcreate_transaction(tx: TransactionCreate):

"""添加交易记录"""

    tx_id = add_transaction(

amount=tx.amount,

tx_type=tx.type,

category=tx.category,

subcategory=tx.subcategory,

note=tx.note,

tx_date=tx.transaction_date

    )

return {"id": tx_id, "message""交易记录已添加"}

@app.get("/api/transactions")

deflist_transactions(

tx_type: Optional[str] = Query(None),

category: Optional[str] = Query(None),

start_date: Optional[str] = Query(None),

end_date: Optional[str] = Query(None),

limitint = Query(50ge=1le=100),

offsetint = Query(0ge=0)

):

"""获取交易记录(分页 + 筛选)"""

    result = get_transactions(

tx_type=tx_type,

category=category,

start_date=start_date,

end_date=end_date,

limit=limit,

offset=offset

    )

return result

@app.get("/api/summary/monthly")

defmonthly_summary(yearint = Query(2026), monthint = Query(7)):

"""月度统计"""

return get_monthly_summary(year, month)

@app.get("/api/trend/daily")

defdaily_trend(daysint = Query(30ge=7le=365)):

"""每日趋势"""

return get_daily_trend(days)

@app.get("/api/health")

defhealth():

return {"status""running""version""1.0.0"}

```

启动后端:

```bash

cdbackend

uvicornmain:app--reload

# 访问 http://localhost:8000/docs 查看交互式文档

```

---

## 10.3 第二步:搭建前端(React + Chart.js)

### 10.3.1 项目初始化

```bash

cdfrontend

npmcreatevite@latestfinanceflow-dashboard----templatereact

cdfinanceflow-dashboard

npminstallaxioschart.jsreact-chartjs-2date-fns

```

### 10.3.2 主应用布局

```jsx

// src/App.jsx

import{ useState, useEffect }from'react';

importaxiosfrom'axios';

importSummaryCardsfrom'./components/SummaryCards';

importTrendChartfrom'./components/TrendChart';

importCategoryPiefrom'./components/CategoryPie';

importTransactionTablefrom'./components/TransactionTable';

importAddTransactionfrom'./components/AddTransaction';

import'./App.css';

constAPI = 'http://localhost:8000/api';

functionApp() {

const [summarysetSummary=useState(null);

const [trendsetTrend=useState(null);

const [selectedMonthsetSelectedMonth=useState(

newDate().toISOString().slice(07// "2026-07"

    );

useEffect(() => {

const [yearmonth= selectedMonth.split('-').map(Number);

Promise.all([

            axios.get(`${API}/summary/monthly`, { params: { year, month } }),

            axios.get(`${API}/trend/daily`, { params: { days:30 } })

        ])

        .then(([summaryRestrendRes]) => {

setSummary(summaryRes.data);

setTrend(trendRes.data);

        })

        .catch(err=> console.error('加载数据失败:', err));

    }, [selectedMonth]);

return (

<divclassName="app">

<headerclassName="header">

<h1>💰 FinanceFlow</h1>

<input

type="month"

value={selectedMonth}

onChange={e=>setSelectedMonth(e.target.value)}

className="month-picker"

/>

</header>

<mainclassName="main-content">

<SummaryCardssummary={summary}/>

<TrendCharttrend={trend}/>

<divclassName="bottom-row">

<CategoryPiesummary={summary}/>

<TransactionTable/>

</div>

<AddTransaction/>

</main>

</div>

    );

}

exportdefaultApp;

```

### 10.3.3 统计卡片组件

```jsx

// src/components/SummaryCards.jsx

functionSummaryCards({ summary }) {

if (!summary) return<div>加载中...</div>;

constcards= [

        { title:'本月收入'value: summary.income, color:'#4caf50'icon:'📈' },

        { title:'本月支出'value: summary.expense, color:'#ef5350'icon:'📉' },

        { title:'本月结余'value: summary.balance, color:'#2196f3'icon:'💰' },

    ];

return (

<divclassName="summary-cards">

{cards.map(card=> (

<divkey={card.title}className="card"style={borderLeftColor: card.color }}>

<divclassName="card-icon">{card.icon}</div>

<divclassName="card-title">{card.title}</div>

<divclassName="card-value"style={color: card.color }}>

                        ¥{card.value.toLocaleString()}

</div>

</div>

            ))}

</div>

    );

}

exportdefaultSummaryCards;

```

### 10.3.4 趋势折线图

```jsx

// src/components/TrendChart.jsx

import{ Line }from'react-chartjs-2';

functionTrendChart({ trend }) {

if (!trend || trend.dates.length===0) {

return<div>暂无趋势数据</div>;

    }

constdata= {

labels: trend.dates.map(d=> d.slice(5)), // 只显示 MM-DD

datasets: [

            {

label:'收入',

data: trend.income,

borderColor:'#4caf50',

backgroundColor:'rgba(76, 175, 80, 0.1)',

tension:0.3,

fill:true

            },

            {

label:'支出',

data: trend.expense,

borderColor:'#ef5350',

backgroundColor:'rgba(239, 83, 80, 0.1)',

tension:0.3,

fill:true

            }

        ]

    };

constoptions= {

responsive:true,

plugins: {

title: { display:truetext:'30天收支趋势'font: { size:16 } }

        },

scales: {

y: { beginAtZero:true }

        }

    };

return<Linedata={data}options={options}/>;

}

exportdefaultTrendChart;

```

### 10.3.5 CSS 样式

```css

/* src/App.css */

.app {

min-height100vh;

background#f0f2f5;

}

.header {

backgroundwhite;

padding16px24px;

box-shadow01px3pxrgba(0,0,0,0.1);

displayflex;

justify-contentspace-between;

align-itemscenter;

}

.main-content {

padding24px;

max-width1400px;

margin0auto;

}

.summary-cards {

displaygrid;

grid-template-columnsrepeat(auto-fitminmax(200px1fr));

gap16px;

margin-bottom24px;

}

.card {

backgroundwhite;

border-radius12px;

padding20px;

border-left4pxsolid;

box-shadow02px8pxrgba(0,0,0,0.08);

}

.card-title {

color#888;

font-size14px;

margin8px0;

}

.card-value {

font-size28px;

font-weightbold;

}

.bottom-row {

displaygrid;

grid-template-columns1fr1fr;

gap24px;

margin-top24px;

}

@media (max-width768px) {

.bottom-row {

grid-template-columns1fr;

    }

}

```

---

## 10.4 第三步:接入 AI 智能分析

### 10.4.1 AI 分析接口

```python

# backend/ai.py

from langchain_openai import ChatOpenAI

from langchain_core.prompts import ChatPromptTemplate

from langchain_core.output_parsers import StrOutputParser

from crud import get_monthly_summary, get_transactions

from datetime import datetime

defanalyze_financial_report(yearintmonthint) -> str:

"""AI 月度财务报告生成"""

    llm = ChatOpenAI(model="gpt-4o-mini"temperature=0)

# 获取当月数据

    summary = get_monthly_summary(year, month)

    transactions = get_transactions(limit=100tx_type="支出")["transactions"]

# 构建上下文

    context = f"""

当前月份: {year}{month}

本月收入: ¥{summary['income']:,.2f}

本月支出: ¥{summary['expense']:,.2f}

本月结余: ¥{summary['balance']:,.2f}

结余率: {summary['income'] / summary['expense'] * 100:.1f}% if summary['expense'] > 0 else 0

主要支出分类:

{chr(10).join([f"  - {cat['category']}: ¥{cat['total']:,.2f}"for cat in summary.get('category_breakdown', [])])}

最近支出记录:

{chr(10).join([f"  - {tx['category']} ({tx['subcategory']}): ¥{tx['amount']:.2f}{tx['note']}"for tx in transactions[-10:]])}

"""

# 构建 Prompt

    prompt = ChatPromptTemplate.from_messages([

        ("system""""你是一个专业的财务顾问 AI。根据用户提供的财务数据,

给出简洁的分析和建议。请遵循以下规则:

1. 用中文回答

2. 语气友好专业

3. 包含数据洞察(发现了什么趋势或问题)

4. 给出可执行的建议

5. 控制在 300 字以内"""),

        ("human""请分析以下财务数据并给出报告:\n{context}")

    ])

    chain = prompt | llm | StrOutputParser()

return chain.invoke({"context": context})

```

### 10.4.2 在 FastAPI 中暴露 AI 接口

```python

# main.py (新增路由)

from ai import analyze_financial_report

@app.get("/api/ai/report")

defai_report(yearint = Query(2026), monthint = Query(7)):

"""AI 生成月度财务分析报告"""

try:

        report = analyze_financial_report(year, month)

return {

"year": year,

"month": month,

"report": report

        }

exceptExceptionas e:

raise HTTPException(status_code=500detail=str(e))

```

### 10.4.3 前端展示 AI 报告

```jsx

// src/components/AIReport.jsx

import{ useState }from'react';

importaxiosfrom'axios';

functionAIReport({ yearmonth }) {

const [reportsetReport=useState(null);

const [loadingsetLoading=useState(false);

constgenerateReport=async () => {

setLoading(true);

try {

constres=await axios.get('http://localhost:8000/api/ai/report', {

params: { year, month }

            });

setReport(res.data.report);

        } catch (err) {

alert('报告生成失败');

        } finally {

setLoading(false);

        }

    };

return (

<divclassName="ai-report">

<h3>🤖 AI 智能分析报告</h3>

<buttononClick={generateReport}disabled={loading}>

{loading ?'生成中...':'生成月度报告'}

</button>

{report && (

<divclassName="report-content"style={{

marginTop:'16px',

padding:'16px',

background:'#fff8e1',

borderRadius:'8px',

whiteSpace:'pre-wrap',

lineHeight:1.6

                }}>

{report}

</div>

            )}

</div>

    );

}

exportdefaultAIReport;

```

---

## 10.5 第四步:数据导出

```python

# backend/main.py (新增)

import io

from fastapi.responses import StreamingResponse

@app.get("/api/export/csv")

defexport_csv(start_datestr = Noneend_datestr = None):

"""导出交易记录为 CSV"""

from crud import get_transactions

    result = get_transactions(start_date=start_date, end_date=end_date, limit=10000)

    csv_buffer = io.StringIO()

    csv_buffer.write("id,transaction_date,type,category,subcategory,amount,note\n")

for tx in result["transactions"]:

        csv_buffer.write(

f'{tx["id"]},{tx["transaction_date"]},{tx["type"]},'

f'{tx["category"]},{tx["subcategory"]},{tx["amount"]},{tx["note"]}\n'

        )

    csv_buffer.seek(0)

return StreamingResponse(

iter([csv_buffer.getvalue()]),

media_type="text/csv",

headers={"Content-Disposition""attachment; filename=transactions.csv"}

    )

```

---

## 10.6 运行项目

```bash

# 终端 1:启动后端

cdbackend

uvicornmain:app--reload

# 终端 2:启动前端

cdfrontend/financeflow-dashboard

npmrundev

# 终端 3(可选):填充一些测试数据

python-c"

from crud import add_transaction

for i in range(50):

    add_transaction(

        amount=50 + i * 10,

        tx_type='支出' if i % 3 != 0 else '收入',

        category=['餐饮', '交通', '购物', '工资'][i % 4],

        note=f'测试记录 {i+1}'

    )

print('已插入 50 条测试数据')

"

# 然后在浏览器打开 http://localhost:5173 查看 Dashboard

```

---

## 10.7 扩展方向

这个项目完成后,你还可以继续扩展:

```

🔄 实时数据同步 —— WebSocket 实现实时更新

👤 用户认证 —— JWT Token + 登录注册

📱 移动端适配 —— PWA / React Native

☁️ 云端部署 —— FastAPI 部署到云 + React 部署到 Vercel

📧 邮件周报 —— 每周自动发送财务摘要

🔔 预算提醒 —— 支出超预算时推送通知

💾 PostgreSQL —— 替代 SQLite 提升并发性能

```

---

## 10.8 知识点小结

| 知识点 | 在本项目中的应用 |

|--------|----------------|

| Python 基础 | CRUD 逻辑、数据清洗、业务规则 |

| 爬虫 | 采集外部财经数据辅助分析 |

| Pandas | 大规模数据分析、报表生成 |

| FastAPI | 后端 RESTful API 服务 |

| React | 前端 Dashboard 用户界面 |

| Chart.js | 数据可视化图表 |

| LangChain | AI 智能分析 + 自然语言问答 |

| SQLite | 本地数据持久化 |

---

## 10.9 第一阶段总结

恭喜你完成了 Python 全栈开发的第一阶段!回顾这条学习路径:

```

Episode 01-04  Python 基础打底

     ↓

Episode 05    获取外部数据(爬虫)

     ↓

Episode 06    理解内部数据(分析)

     ↓

Episode 07    提供服务(后端 API)

     ↓

Episode 08    赋予智能(AI + RAG)

     ↓

Episode 09    呈现给用户(前端 React)

     ↓

Episode 10    融会贯通(完整项目)

```

你现在具备了从零搭建一个完整 Web 应用的能力——从数据库到 API 到 AI 到前端。

---

## 10.10 后续计划预告

第一阶段到此结束,但学习永无止境!以下是后续可能的方向:

-**Episode 11**:Docker 容器化部署 —— 让你的项目一键上线

-**Episode 12**:数据库进阶 —— PostgreSQL + SQLAlchemy + Alembic

-**Episode 13**:Celery 异步任务 —— 定时报表、邮件发送

-**Episode 14**:单元测试与 CI/CD —— 自动化测试 + 持续集成

-**Episode 15**:微服务架构 —— 把大项目拆成独立服务

无论你选择哪条路,请记住:**最好的学习方式就是做一个真正的项目**。FinanceFlow 只是一个开始,你可以用它来分析自己的消费习惯,也可以扩展成公司级的数据平台。

感谢你这十期的陪伴,愿 Python 成为你手中最锋利的工具!🐍🚀✨

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-08-21 15:51:05 HTTP/2.0 GET : https://f.mffb.com.cn/a/504791.html
  2. 运行时间 : 0.371493s [ 吞吐率:2.69req/s ] 内存消耗:4,614.81kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=fc77eda4dc125f426b93ab67137d1690
  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.001139s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001783s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.035952s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000946s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001788s ]
  6. SELECT * FROM `set` [ RunTime:0.003080s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.002016s ]
  8. SELECT * FROM `article` WHERE `id` = 504791 LIMIT 1 [ RunTime:0.025031s ]
  9. UPDATE `article` SET `lasttime` = 1787298665 WHERE `id` = 504791 [ RunTime:0.055524s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.025395s ]
  11. SELECT * FROM `article` WHERE `id` < 504791 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000549s ]
  12. SELECT * FROM `article` WHERE `id` > 504791 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.004171s ]
  13. SELECT * FROM `article` WHERE `id` < 504791 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000648s ]
  14. SELECT * FROM `article` WHERE `id` < 504791 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.026852s ]
  15. SELECT * FROM `article` WHERE `id` < 504791 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000979s ]
0.373122s