当前位置:首页>python>Python Tkinter 视觉效果优化:扁平化与美观主题实战指南

Python Tkinter 视觉效果优化:扁平化与美观主题实战指南

  • 2026-04-02 05:46:39
Python Tkinter 视觉效果优化:扁平化与美观主题实战指南

做过 Tkinter 项目的人,多少都听过这句话——"这界面怎么这么土?"

不冤枉。默认的 Tkinter 界面,灰底灰按钮,控件边框带着浮雕感,字体是系统默认的宋体,整体风格停留在 Windows XP 时代。拿去给客户演示,对方第一反应往往是:"这是正式版吗?"

问题不在于 Tkinter 本身能力不行,而在于大多数教程只教你怎么"摆控件",从来不讲怎么让它好看。底层的 ttk 主题引擎、Style 配置系统、Canvas 自绘机制,这些才是让界面脱胎换骨的关键,却鲜有人系统讲过。

这篇文章就干这件事。从原理到代码,从快速美化到深度定制,给你一套在 Windows 下把 Tkinter 界面做到"现代感"的完整方案。所有代码在 Python 3.10 + Windows 11 环境下验证可运行。


🔍 先搞清楚:Tkinter 的视觉体系是怎么运作的

很多人不知道,Tkinter 其实有两套控件体系并存——tkinter(经典控件)和 tkinter.ttk(主题控件)。

经典控件,比如 tk.Buttontk.Label,样式完全靠属性硬写,bgfgrelief,每个控件单独配,改起来费劲,统一性也差。ttk 控件则不同,它引入了主题(Theme)机制,通过 ttk.Style 统一管理所有控件的外观,一处改,全局生效。

import tkinter.ttk as ttkstyle = ttk.Style()print(style.theme_names())# ('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnative')

Windows 下内置了 vistawinnativexpnative 等主题,但说实话,这几个主题的审美水准……和"现代"二字还差得远。clam 主题相对简洁,是自定义改造的最佳基底——后面咱们会重点用它。

核心结论:做视觉优化,优先用 ttk 控件 + ttk.Style 定制,而不是给每个 tk 控件单独设属性。


🚀 方案一:基于 ttkbootstrap 的快速现代化

如果项目工期紧,想最快速度出效果,ttkbootstrap 是目前最成熟的选择。它是对 ttk 的封装,内置了十几套 Bootstrap 风格主题,引入成本极低,做过web前端的一看就知道怎么个玩意了。

pip install ttkbootstrap

直接看效果对比——原始代码:

# 原始 Tkinter 界面(灰色时代)import tkinter as tkroot = tk.Tk()root.title("原始界面")tk.Label(root, text="用户名").pack()tk.Entry(root).pack()tk.Button(root, text="登录").pack()root.mainloop()

换成 ttkbootstrap 之后:

import ttkbootstrap as ttk  from ttkbootstrap.constants import *  # 一行代码切换主题  root = ttk.Window(themename="cosmo")  # 可选: flatly, darkly, superhero, journal...  root.title("bootstrap风格的登录界面")  root.geometry("400x300")  frame = ttk.Frame(root, padding=20)  frame.pack(fill="both", expand=True)  ttk.Label(frame, text="用户名", bootstyle="secondary").pack(anchor="w")  ttk.Entry(frame, bootstyle="primary").pack(fill="x", pady=(412))  ttk.Label(frame, text="密码", bootstyle="secondary").pack(anchor="w")  ttk.Entry(frame, show="*", bootstyle="primary").pack(fill="x", pady=(420))  # bootstyle 参数控制颜色语义:primary/success/danger/warning/info  ttk.Button(frame, text="登录", bootstyle="primary", width=20).pack()  root.mainloop()

bootstyle 参数是 ttkbootstrap 的核心概念——它不是颜色,是语义primary 是主色调,danger 是警告红,success 是确认绿,换主题时这些语义颜色自动跟着变,不需要改任何代码。

踩坑预警: ttkbootstrap 和原生 tk 控件混用会出现样式不一致的情况。建议整个项目统一用 ttkbootstrap 的控件,不要混搭 tk.Button 之类的经典控件。


🎨 方案二:纯手工定制 ttk.Style(零依赖)

不想引入第三方库?完全可以。ttk.Style 的配置能力比大多数人想象的强得多。

下面是一套完整的扁平化主题配置,从颜色系统到控件样式,一次性定义清楚:

import tkinter as tk  from tkinter import ttk  # ── 颜色系统(改这里就能换整体风格)──  COLORS = {  "bg_primary":     "#1e1e2e",  # 主背景(深色)  "bg_secondary":   "#2a2a3e",  # 次级背景  "bg_card":        "#313244",  # 卡片背景  "accent":         "#cba6f7",  # 强调色(紫)  "accent_hover":   "#b4befe",  # 悬停色  "text_primary":   "#cdd6f4",  # 主文字  "text_secondary""#a6adc8",  # 次级文字  "success":        "#a6e3a1",  # 成功绿  "danger":         "#f38ba8",  # 警告红  "border":         "#45475a",  # 边框色  }  defapply_flat_theme(root):  """      应用扁平化深色主题      基于 clam 主题改造,保留 ttk 的主题引擎      """    root.configure(bg=COLORS["bg_primary"])      style = ttk.Style()      style.theme_use("clam")  # ── Frame ──      style.configure("TFrame", background=COLORS["bg_primary"])      style.configure("Card.TFrame", background=COLORS["bg_card"], relief="flat")  # ── Label ──      style.configure(  "TLabel",          background=COLORS["bg_primary"],          foreground=COLORS["text_primary"],          font=("Microsoft YaHei UI"10)      )      style.configure(  "Title.TLabel",          font=("Microsoft YaHei UI"16"bold"),          foreground=COLORS["accent"]      )    style.configure(  "Muted.TLabel",          foreground=COLORS["text_secondary"],          font=("Microsoft YaHei UI"9)      )  # ── Button ──      style.configure(  "TButton",          background=COLORS["accent"],          foreground=COLORS["bg_primary"],          font=("Microsoft YaHei UI"10"bold"),          borderwidth=0,          relief="flat",          padding=(168)      )      style.map(  "TButton",          background=[              ("active",   COLORS["accent_hover"]),              ("disabled", COLORS["border"])          ],          foreground=[("disabled", COLORS["text_secondary"])]      )  # 幽灵按钮      style.configure(  "Ghost.TButton",          background=COLORS["bg_primary"],          foreground=COLORS["accent"],          borderwidth=1,          relief="solid",          padding=(147)      )      style.map(  "Ghost.TButton",          background=[("active", COLORS["bg_secondary"])]      )  # 危险按钮      style.configure(  "Danger.TButton",          background=COLORS["danger"],          foreground=COLORS["bg_primary"],          font=("Microsoft YaHei UI"10"bold"),          borderwidth=0,          relief="flat",          padding=(168)      )      style.map(  "Danger.TButton",          background=[("active""#e07090")]      )  # ── Entry ──      style.configure(  "TEntry",          fieldbackground=COLORS["bg_secondary"],          foreground=COLORS["text_primary"],          insertcolor=COLORS["accent"],          borderwidth=1,          relief="flat",          padding=(106)      )      style.map(  "TEntry",          fieldbackground=[("focus", COLORS["bg_card"])],          bordercolor=[              ("focus",  COLORS["accent"]),              ("!focus", COLORS["border"])          ]      )  # ── Combobox ──      style.configure(  "TCombobox",          fieldbackground=COLORS["bg_secondary"],          background=COLORS["bg_secondary"],          foreground=COLORS["text_primary"],          arrowcolor=COLORS["accent"],          borderwidth=1,          relief="flat"    )  # ── Treeview ──      style.configure(  "Treeview",          background=COLORS["bg_secondary"],          foreground=COLORS["text_primary"],          fieldbackground=COLORS["bg_secondary"],          rowheight=32,          borderwidth=0,          font=("Microsoft YaHei UI"9)      )      style.configure(  "Treeview.Heading",          background=COLORS["bg_card"],          foreground=COLORS["text_secondary"],          font=("Microsoft YaHei UI"9"bold"),          relief="flat",          borderwidth=0    )      style.map(  "Treeview",          background=[("selected", COLORS["accent"])],          foreground=[("selected", COLORS["bg_primary"])]      )  # ── Scrollbar ──      style.configure(  "Vertical.TScrollbar",          background=COLORS["bg_card"],          troughcolor=COLORS["bg_secondary"],          borderwidth=0,          arrowsize=0,          width=6    )      style.map(  "Vertical.TScrollbar",          background=[("active", COLORS["border"])]      )  # ── Progressbar ──      style.configure(  "TProgressbar",          troughcolor=COLORS["bg_card"],          background=COLORS["accent"],          borderwidth=0,          thickness=6    )  return style  defbuild_demo_ui(root, style):  """构建完整演示界面,覆盖所有主题组件"""    root.title("Flat Dark Theme — Demo")      root.geometry("780x600")      root.resizable(FalseFalse)  # ── 外层滚动容器 ──    canvas = tk.Canvas(          root,          bg=COLORS["bg_primary"],          highlightthickness=0    )      scrollbar = ttk.Scrollbar(          root,          orient="vertical",          command=canvas.yview,          style="Vertical.TScrollbar"    )      canvas.configure(yscrollcommand=scrollbar.set)      scrollbar.pack(side="right", fill="y")      canvas.pack(side="left", fill="both", expand=True)  # 内容主框架(放进 canvas)      main = ttk.Frame(canvas)      main_window = canvas.create_window((00), window=main, anchor="nw")  def_on_frame_configure(e):          canvas.configure(scrollregion=canvas.bbox("all"))  def_on_canvas_configure(e):          canvas.itemconfig(main_window, width=e.width)      main.bind("<Configure>", _on_frame_configure)      canvas.bind("<Configure>", _on_canvas_configure)  # 鼠标滚轮支持  def_on_mousewheel(e):          canvas.yview_scroll(int(-1 * (e.delta / 120)), "units")      canvas.bind_all("<MouseWheel>", _on_mousewheel)      pad = {"padx"32"pady"12}  # ── 标题区 ──    header = ttk.Frame(main)      header.pack(fill="x", padx=32, pady=(284))      ttk.Label(header, text="Flat Dark Theme", style="Title.TLabel").pack(anchor="w")      ttk.Label(          header,          text="基于 ttk clam 引擎的扁平化深色主题演示",          style="Muted.TLabel"    ).pack(anchor="w", pady=(20))      ttk.Separator(main, orient="horizontal").pack(fill="x", padx=32, pady=8)  # ── 卡片:按钮组 ──    _section_title(main, "按钮 Buttons")      btn_card = ttk.Frame(main, style="Card.TFrame", padding=20)      btn_card.pack(fill="x", **pad)      btn_row = ttk.Frame(btn_card, style="Card.TFrame")      btn_row.pack(anchor="w")      ttk.Button(btn_row, text="主要按钮").pack(side="left", padx=(010))      ttk.Button(btn_row, text="幽灵按钮", style="Ghost.TButton").pack(side="left", padx=(010))      ttk.Button(btn_row, text="危险操作", style="Danger.TButton").pack(side="left", padx=(010))      ttk.Button(btn_row, text="已禁用", state="disabled").pack(side="left")  # ── 卡片:输入框 ──    _section_title(main, "输入框 Entry & Combobox")      entry_card = ttk.Frame(main, style="Card.TFrame", padding=20)      entry_card.pack(fill="x", **pad)      ttk.Label(          entry_card,          text="用户名",          style="Muted.TLabel",          background=COLORS["bg_card"]      ).pack(anchor="w")      username_var = tk.StringVar(value="")      ttk.Entry(entry_card, textvariable=username_var, width=36).pack(          anchor="w", pady=(412)      )      ttk.Label(          entry_card,          text="角色",          style="Muted.TLabel",          background=COLORS["bg_card"]      ).pack(anchor="w")      combo_var = tk.StringVar(value="管理员")      ttk.Combobox(          entry_card,          textvariable=combo_var,          values=["管理员""编辑""访客"],          width=34,          state="readonly"    ).pack(anchor="w", pady=(40))  # ── 卡片:进度条 ──    _section_title(main, "进度条 Progressbar")      prog_card = ttk.Frame(main, style="Card.TFrame", padding=20)      prog_card.pack(fill="x", **pad)      prog_var = tk.IntVar(value=68)      ttk.Progressbar(          prog_card,          variable=prog_var,          maximum=100,          length=500    ).pack(anchor="w")      ttk.Label(          prog_card,          text="当前进度:68%",          style="Muted.TLabel",          background=COLORS["bg_card"]      ).pack(anchor="w", pady=(60))  # ── 卡片:Treeview 表格 ──    _section_title(main, "表格 Treeview")      tree_card = ttk.Frame(main, style="Card.TFrame", padding=20)      tree_card.pack(fill="x", **pad)      columns = ("id""name""role""status")      tree = ttk.Treeview(tree_card, columns=columns, show="headings", height=5)      tree.heading("id",     text="ID")      tree.heading("name",   text="姓名")      tree.heading("role",   text="角色")      tree.heading("status", text="状态")      tree.column("id",     width=60,  anchor="center")      tree.column("name",   width=160, anchor="w")      tree.column("role",   width=120, anchor="center")      tree.column("status", width=100, anchor="center")      sample_data = [          ("001""Alice",   "管理员""在线"),          ("002""Bob",     "编辑",   "离线"),          ("003""Charlie""访客",   "在线"),          ("004""Diana",   "编辑",   "在线"),          ("005""Eve",     "访客",   "离线"),      ]  for row in sample_data:          tree.insert("""end", values=row)      tree.pack(fill="x")  # ── 底部间距 ──    ttk.Frame(main, height=24).pack()  def_section_title(parent, text):  """小节标题辅助函数"""    ttk.Label(          parent,          text=text,          style="Muted.TLabel"    ).pack(anchor="w", padx=32, pady=(160))  if __name__ == "__main__":      root = tk.Tk()      style = apply_flat_theme(root)      build_demo_ui(root, style)      root.mainloop()

这套配置有几个设计决策值得解释一下。

clam 作为基底,是因为它的控件结构比 default 更容易被覆盖——default 主题有些属性是硬编码在 Tcl 层面的,Python 这边改不动。clam 相对"干净",改造空间大。

style.map() 是处理状态变化的关键方法,用于定义鼠标悬停(active)、禁用(disabled)、聚焦(focus)等状态下的样式差异。只用 configure() 的话,按钮按下去没有任何视觉反馈,体验很差。


🪟 方案三:Canvas 自绘——突破 ttk 的天花板

ttk.Style 能覆盖大部分场景,但有些效果它做不到——圆角按钮、渐变背景、自定义进度条动画。这时候就得上 Canvas 自绘了。

下面实现一个带圆角和悬停效果的自定义按钮

import math  import tkinter as tk  classRoundedButton(tk.Canvas):  """      圆角按钮,纯 Canvas 实现      支持悬停颜色变化和点击回调      """def__init__(self, parent, text, command=None,                   width=120, height=36,                   radius=8,                   bg_normal="#cba6f7",                   bg_hover="#b4befe",                   bg_press="#a0a8d8",                   fg="#1e1e2e",                   font=("Microsoft YaHei UI"10"bold"),                   **kwargs):  super().__init__(              parent,              width=width, height=height,              bg=parent.cget("bg"),              highlightthickness=0,              **kwargs          )  self.command = command  self.bg_normal = bg_normal  self.bg_hover = bg_hover  self.bg_press = bg_press  self.radius = radius  self.width_ = width  self.height_ = height  self._rect = self._draw_rounded_rect(bg_normal, radius)  self._text = self.create_text(              width // 2, height // 2,              text=text, fill=fg, font=font          )  self.bind("<Enter>"self._on_enter)  self.bind("<Leave>"self._on_leave)  self.bind("<ButtonPress-1>"self._on_press)  self.bind("<ButtonRelease-1>"self._on_release)  def_draw_rounded_rect(self, color, r):          w, h = self.width_, self.height_  self.delete("rounded_rect")  # 动态采样点:确保每个圆角至少有 72 个采样点          N = max(72int(r * 10))          points = []          corners = [              (r, r, 180270),              (w - r, r, 270360),              (w - r, h - r, 090),              (r, h - r, 90180),          ]  for cx, cy, a_start, a_end in corners:  for i inrange(N + 1):                  angle = math.radians(a_start + (a_end - a_start) * i / N)                  points.append(cx + r * math.cos(angle))                  points.append(cy + r * math.sin(angle))  self.create_polygon(              points,              smooth=False,              fill=color,              outline="",              tags="rounded_rect"        )  ifhasattr(self"_text"):  self.tag_raise(self._text)  return"rounded_rect"def_set_color(self, color):  self.itemconfig("rounded_rect", fill=color)  def_on_enter(self, _):  self._set_color(self.bg_hover)  self.config(cursor="hand2")  def_on_leave(self, _):  self._set_color(self.bg_normal)  self.config(cursor="")  def_on_press(self, _):  self._set_color(self.bg_press)  def_on_release(self, _):  self._set_color(self.bg_hover)  ifself.command:  self.command()  classApp(tk.Tk):  def__init__(self):  super().__init__()  self.title("RoundedButton 测试")  self.resizable(FalseFalse)  self.configure(bg="#1e1e2e")  # ── 顶部标题 ──────────────────────────────        tk.Label(  self, text="圆角按钮演示",              bg="#1e1e2e", fg="#cdd6f4",              font=("Microsoft YaHei UI"14"bold")          ).pack(pady=(244))          tk.Label(  self, text="悬停 / 按下 / 松开,观察颜色变化",              bg="#1e1e2e", fg="#6c7086",              font=("Microsoft YaHei UI"9)          ).pack(pady=(020))  # ── 计数器显示 ────────────────────────────        self._count = 0  self._count_var = tk.StringVar(value="点击次数:0")          tk.Label(  self, textvariable=self._count_var,              bg="#1e1e2e", fg="#a6e3a1",              font=("Microsoft YaHei UI"11)          ).pack(pady=(016))  # ── 按钮区域 ──────────────────────────────        btn_frame = tk.Frame(self, bg="#1e1e2e")          btn_frame.pack(padx=32, pady=(012))  # 默认紫色按钮          RoundedButton(              btn_frame, text="点我计数",              command=self._increment,              width=130, height=38        ).grid(row=0, column=0, padx=8, pady=8)  # 绿色主题按钮          RoundedButton(              btn_frame, text="重置",              command=self._reset,              width=100, height=38,              bg_normal="#a6e3a1",              bg_hover="#94d3a2",              bg_press="#7abf8a",              fg="#1e1e2e"        ).grid(row=0, column=1, padx=8, pady=8)  # 红色主题按钮          RoundedButton(              btn_frame, text="退出",              command=self.destroy,              width=100, height=38,              bg_normal="#f38ba8",              bg_hover="#e07090",              bg_press="#c85878",              fg="#1e1e2e"        ).grid(row=0, column=2, padx=8, pady=8)  # ── 大尺寸 / 大圆角 展示 ─────────────────        tk.Label(  self, text="不同尺寸 & 圆角半径",              bg="#1e1e2e", fg="#6c7086",              font=("Microsoft YaHei UI"9)          ).pack(pady=(86))          size_frame = tk.Frame(self, bg="#1e1e2e")          size_frame.pack(padx=32, pady=(024))          RoundedButton(              size_frame, text="小按钮",              width=80, height=26, radius=6,              bg_normal="#89b4fa", bg_hover="#74a8f5",              bg_press="#5a8ee0", fg="#1e1e2e",              font=("Microsoft YaHei UI"8"bold")          ).grid(row=0, column=0, padx=8)          RoundedButton(              size_frame, text="标准按钮",              width=120, height=36, radius=10,              bg_normal="#cba6f7", bg_hover="#b4befe",              bg_press="#a0a8d8", fg="#1e1e2e"        ).grid(row=0, column=1, padx=8)          RoundedButton(              size_frame, text="大  按  钮",              width=180, height=50, radius=18,              bg_normal="#fab387", bg_hover="#f09070",              bg_press="#d87858", fg="#1e1e2e",              font=("Microsoft YaHei UI"12"bold")          ).grid(row=0, column=2, padx=8)  # ── 状态栏 ────────────────────────────────        self._status_var = tk.StringVar(value="就绪")          tk.Label(  self, textvariable=self._status_var,              bg="#181825", fg="#585b70",              font=("Microsoft YaHei UI"8),              anchor="w", padx=10        ).pack(fill="x", side="bottom", ipady=4)  # ── 回调 ──────────────────────────────────────    def _increment(self):  self._count += 1self._count_var.set(f"点击次数:{self._count}")  self._status_var.set(f"已点击 {self._count} 次")  def_reset(self):  self._count = 0self._count_var.set("点击次数:0")  self._status_var.set("已重置")  if __name__ == "__main__":      App().mainloop()

用法和普通按钮一样,直接 pack() 或 grid()

btn = RoundedButton(    frame, text="开始处理",    command=lambdaprint("clicked"),    width=140, height=40, radius=10)btn.pack(pady=10)

smooth=True 是圆角效果的关键参数,它让折线多边形的顶点变成曲线过渡。highlightthickness=0 去掉 Canvas 默认的焦点边框,否则点击后会出现一圈蓝色虚线,很丑。


⚠️ 几个必须注意的细节

字体选择是视觉的灵魂。 Windows 下用 Microsoft YaHei UI(微软雅黑 UI),比普通微软雅黑渲染更清晰,尤其是小字号。代码字体用 Consolas。千万别用宋体——那是上个时代的遗留物。

ipady 和 padding 的区别。ipady 是 pack()/grid() 布局管理器的内边距,影响控件占位;padding 是 ttk.Style 里的内边距,影响控件内容区域。两者叠加使用,才能让输入框有足够的点击区域。

深色主题下的滚动条问题。 默认滚动条在深色背景下会显示白色边框,用 style.configure("Vertical.TScrollbar", borderwidth=0) 去掉,再配合 arrowsize=0 隐藏箭头,才能得到那种细线滚动条的现代感。

Canvas 按钮的"白边"问题。 Canvas 的 bg 参数必须设为父容器的背景色,否则圆角之外的区域会露出白色(或灰色)背景,圆角效果就毁了。用 parent.cget("bg") 动态获取父容器颜色,比硬编码颜色值更健壮。


💡 三句话技术洞察

ttk.Style 是 Tkinter 的 CSS,学会它就等于掌握了全局样式控制权。

颜色系统先于控件样式——把颜色统一定义在字典里,后期换肤只改一处。

Canvas 自绘是突破 ttk 限制的最后手段,不到必要不动用,维护成本比 Style 高一个量级。


本文从 ttk.Style 的主题机制讲起,覆盖了 ttkbootstrap 快速方案、纯手工扁平化主题定制,以及 Canvas 圆角按钮的自绘实现,最后整合成一个完整的登录窗口示例。三套方案各有适用场景,按需取用即可。欢迎在评论区聊聊你在 Tkinter 界面美化上踩过的坑,或者分享你自己的主题配色方案。


🏷️ PythonTkinterGUI开发扁平化设计Windows桌面开发

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-04 10:26:02 HTTP/2.0 GET : https://f.mffb.com.cn/a/483963.html
  2. 运行时间 : 0.183120s [ 吞吐率:5.46req/s ] 内存消耗:4,985.67kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=26edeba588cde3f4ae86ba2f8a121b9c
  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.001122s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001747s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000754s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000700s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001348s ]
  6. SELECT * FROM `set` [ RunTime:0.000712s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001485s ]
  8. SELECT * FROM `article` WHERE `id` = 483963 LIMIT 1 [ RunTime:0.001570s ]
  9. UPDATE `article` SET `lasttime` = 1775269562 WHERE `id` = 483963 [ RunTime:0.001725s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000600s ]
  11. SELECT * FROM `article` WHERE `id` < 483963 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001119s ]
  12. SELECT * FROM `article` WHERE `id` > 483963 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001122s ]
  13. SELECT * FROM `article` WHERE `id` < 483963 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002199s ]
  14. SELECT * FROM `article` WHERE `id` < 483963 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002222s ]
  15. SELECT * FROM `article` WHERE `id` < 483963 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002269s ]
0.186886s