跳到内容
当前位置:首页>小程序源码>【上班定时休息提醒小程序】附python代码

【上班定时休息提醒小程序】附python代码

  • 2026-09-25 08:53:26
【上班定时休息提醒小程序】附python代码
许多脑力劳动岗位需长久地坐在电子屏幕前。
长期如此,可能导致视力下降、肩颈腰背酸痛、代谢变慢易发胖等健康问题。
对此,本程序应运而生,引入定时提醒功能:
  • 每隔一小时设置一个闹铃,屏幕出现大量闪烁字体“王子公主请休息”,同时系统发出尖锐爆鸣声(闹铃)。
  • 点击字体关闭闹铃,要求眼疾手快(要在字体实体化时点到)。
  • 如果不人为关闭,闹铃将持续40s,不会再次触发,闹钟列表中相应条目变灰。
  • 点击左下角齿轮,进入后台修改设置。可修改字体内容、铃声音量、闹铃开关状态等。
  • 过午夜12点重置所有闹钟。

  • 为了不妨碍工作,小程序页面可最小化到托盘。

本程序在上上上篇文章的【上班摸鱼小程序】基础上修改得到。

-END-

代码:

import tkinter as tkfrom tkinter import messageboxfrom datetime import datetime, timedelta import os import sysimport mathimport tkinter.font as tkFont from zhdate import ZhDateimport randomimport threadingimport timeimport tempfileimport waveimport structtry:    import winsoundexcept ImportError:    winsound = Nonetry:    import pystrayexcept ImportError:    pystray = Nonetry:    from PIL import Image, ImageDrawexcept ImportError:    Image = None    ImageDraw = NoneDEFAULT_OFF_WORK_TIME = "17:00:00"off_work_time_str = DEFAULT_OFF_WORK_TIMEBG_COLOR       = "#000000"FG_COLOR       = "#cccccc"TITLE_COLOR    = "#ffffff"ACCENT_RED     = "#ff6b6b"ACCENT_CYAN    = "#ff6b6b"ACCENT_YELLOW  = "#ff6b6b"BUTTON_COLOR   = "#333333"BUTTON_TEXT    = "white"POPUP_BG       = "#1a1a1a"MASK_COLOR     = "#0a0a0a"DIVIDER_COLOR  = "#397a9b"CHINESE_FONT   = "STZhongsong"DEFAULT_ALARMS = [    "08:00", "09:00", "10:00", "11:00",    "15:00", "16:00", "17:00", "18:30", "19:30",]DEFAULT_ALARM_MESSAGE = "王子公主请休息!"ALARM_MEAL_LABELS = {"11:00": "午饭", "17:00": "晚饭"}CAT_IMAGE_PATH = r"D:\BaiduNetdiskDownload\Cat.png"def get_next_holiday_info():    now = datetime.now()    current_year = now.year     spring_festival = ZhDate(current_year, 1, 1).to_datetime()    dragon_boat = ZhDate(current_year, 5, 5).to_datetime()    mid_autumn = ZhDate(current_year, 8, 15).to_datetime()    qingming = datetime(current_year, 4, 4)    holidays = [        (datetime(current_year, 1, 1), "元旦"),        (spring_festival, "春节"),        (qingming, "清明节"),        (datetime(current_year, 5, 1), "劳动节"),        (dragon_boat, "端午节"),        (datetime(current_year, 10, 1), "国庆节"),        (mid_autumn, "中秋节"),    ]    min_diff = None     next_holiday_name = ""    for year_offset in [0, 1]:        year = current_year + year_offset         for holiday_date, name in holidays:            if name == "元旦":                date_obj = datetime(year, 1, 1)            elif name == "春节":                date_obj = ZhDate(year, 1, 1).to_datetime()            elif name == "清明节":                date_obj = datetime(year, 4, 4)            elif name == "劳动节":                date_obj = datetime(year, 5, 1)            elif name == "端午节":                date_obj = ZhDate(year, 5, 5).to_datetime()            elif name == "国庆节":                date_obj = datetime(year, 10, 1)            elif name == "中秋节":                date_obj = ZhDate(year, 8, 15).to_datetime()            else:                continue             if date_obj > now:                diff = date_obj - now                 days = diff.days                 if min_diff is None or days < min_diff:                    min_diff = days                     next_holiday_name = name     if min_diff is not None:        return min_diff, next_holiday_name     return 0, "暂无数据"def calculate_time_diff(target_time_str):    now = datetime.now()    try:        h, m, s = map(int, target_time_str.split(':'))        target_time_today = now.replace(hour=h, minute=m, second=s, microsecond=0)    except ValueError:        return "时间格式错误", ACCENT_RED     if now >= target_time_today:        return "已经下班啦!", ACCENT_RED     delta = target_time_today - now     total_seconds = int(delta.total_seconds())    hours, remainder = divmod(total_seconds, 3600)    minutes, seconds = divmod(remainder, 60)    return f"{hours:02d}时{minutes:02d}分{seconds:02d}秒", ACCENT_RED def get_weekend_diff(target_time_str):    now = datetime.now()    weekday = now.weekday()    if weekday >= 5:        return "现在就是周末哦~", ACCENT_CYAN     try:        h, m, s = map(int, target_time_str.split(':'))    except ValueError:        return "时间格式错误", ACCENT_CYAN     if weekday == 4:        target = now.replace(hour=h, minute=m, second=s, microsecond=0)        delta = target - now         total_seconds = int(delta.total_seconds())        if total_seconds < 0:            return "周末已开始~", ACCENT_CYAN         hours, remainder = divmod(total_seconds, 3600)        minutes, seconds = divmod(remainder, 60)        return f"{hours}小时{minutes}分{seconds}秒", ACCENT_CYAN     else:        days_to_friday = 4 - weekday         target = now + timedelta(days=days_to_friday)        target = target.replace(hour=h, minute=m, second=s, microsecond=0)        delta = target - now         return f"{delta.days}天", ACCENT_CYAN class RoundedButton(tk.Canvas):    def __init__(self, parent, text, command=None, radius=3,                 bg=BUTTON_COLOR, fg="white", font=(CHINESE_FONT, 11)):         tmp_font = tk.font.Font(family=font[0], size=font[1])        text_w = tmp_font.measure(text)        w = text_w + 50         h = 40         super().__init__(parent, width=w, height=h,                         bg=parent["bg"], highlightthickness=0, cursor="hand2")        self.command = command         self.radius = radius         self.bg = bg         self.fg = fg         self.text = text         self.font = font         self._hover = False         self._draw()        self.bind("<Button-1>", lambda e: self.command() if self.command else None)        self.bind("<Enter>", lambda e: self._set_hover(True))        self.bind("<Leave>", lambda e: self._set_hover(False))    def _draw(self):        self.delete("all")        w = self.winfo_reqwidth()        h = self.winfo_reqheight()        r = self.radius         color = "#454545" if self._hover else self.bg         self.create_oval(0, 0, 2*r, 2*r, fill=color, outline=color)        self.create_oval(w-2*r, 0, w, 2*r, fill=color, outline=color)        self.create_oval(0, h-2*r, 2*r, h, fill=color, outline=color)        self.create_oval(w-2*r, h-2*r, w, h, fill=color, outline=color)        self.create_rectangle(r, 0, w-r, h, fill=color, outline=color)        self.create_rectangle(0, r, w, h-r, fill=color, outline=color)        self.create_text(w/2, h/2, text=self.text, fill=self.fg, font=self.font)    def _set_hover(self, hover):        self._hover = hover         self._draw()def create_rounded_image(image_path, size, radius=10):    try:        from PIL import Image, ImageDraw, ImageTk        img = Image.open(image_path).convert("RGBA")        img = img.resize(size, Image.LANCZOS)        mask = Image.new('L', size, 0)        draw = ImageDraw.Draw(mask)        draw.rounded_rectangle([(0, 0), size], radius=radius, fill=255)        result = Image.new('RGBA', size, (0, 0, 0, 0))        result.paste(img, (0, 0), mask)        return ImageTk.PhotoImage(result)    except ImportError:        return None    except Exception as e:        print(f"图片处理错误: {e}")        return Noneclass MiniGameApp:    def __init__(self, parent):        self.top = tk.Toplevel(parent)        self.top.title("摸鱼小游戏")        self.top.geometry("1200x500")         self.top.configure(bg="black")        self.top.resizable(False, False)        self.canvas = tk.Canvas(self.top, width=1200, height=500, bg="black", highlightthickness=0)        self.canvas.pack()        self.top.bind("<KeyPress>", self.on_key_press)        self.top.bind("<KeyRelease>", self.on_key_release)        self.top.bind("<r>", self.restart_game)        self.top.bind("<t>", self.close_game)        self.top.bind("<R>", self.restart_game)        self.top.bind("<T>", self.close_game)        self.GRAVITY = 0.8        self.MAX_CHARGE = 22         self.CHARGE_RATE = 0.4         self.player = {'x': 0, 'y': 0, 'w': 20, 'h': 20, 'vx': 0, 'vy': 0}        self.platforms = []        self.is_charging = False         self.charge_power = 0        self.on_ground = True        self.elasticing = False        self.elastic_timer = 0        self.elastic_duration = 18        self.breaking = False        self.fragments = []        self.break_timer = 0        self.game_over = False        self.game_won = False        self.game_state = 'playing'        self.text_fade = 0.0        self.reset_game()        self.game_loop()    def generate_platforms(self):        self.platforms = []        current_x = 0        self.platforms.append({'x': 0, 'y': 350, 'w': 120, 'h': 50})        current_x = 120         while current_x < 1200:            gap = random.randint(80, 160)            width = random.randint(60, 100)            next_y = random.randint(280, 360)            self.platforms.append({                'x': current_x + gap,                'y': next_y,                'w': width,                'h': 500 - next_y            })            current_x += gap + width    def reset_game(self):        self.generate_platforms()        start_plat = self.platforms[0]        self.player['x'] = start_plat['x'] + 10        self.player['y'] = start_plat['y'] - self.player['h']        self.player['vx'] = 0        self.player['vy'] = 0         self.game_over = False        self.game_won = False         self.is_charging = False         self.charge_power = 0        self.on_ground = True        self.elasticing = False        self.elastic_timer = 0        self.breaking = False        self.fragments = []        self.break_timer = 0        self.game_state = 'playing'        self.text_fade = 0.0        self.draw()    def on_key_press(self, event):        if event.keysym == 'space' and not self.game_over and not self.game_won and self.on_ground:            self.is_charging = True    def on_key_release(self, event):        if event.keysym == 'space' and self.is_charging:            self.jump()            self.is_charging = False             self.charge_power = 0    def jump(self):        self.elasticing = True        self.elastic_timer = 0        self.on_ground = False        self.player['vx'] = 5 + (self.charge_power * 0.6)        self.player['vy'] = -(7 + (self.charge_power * 0.6))    def start_break_animation(self):        self.breaking = True        self.break_timer = 0        self.fragments = []        for i in range(14):            angle = random.uniform(0, 2 * math.pi)            speed = random.uniform(3.5, 8.0)            size = random.randint(4, 8)            self.fragments.append({                'x': self.player['x'] + self.player['w'] / 2,                'y': self.player['y'] + self.player['h'] / 2,                'vx': math.cos(angle) * speed,                'vy': math.sin(angle) * speed,                'size': size,                'alpha': 1.0            })    def _get_faded_color(self, target_color_hex, progress):        if not target_color_hex.startswith('#'):            color_map = {                "red": (255, 0, 0),                "gray": (128, 128, 128)            }            if target_color_hex in color_map:                rgb = color_map[target_color_hex]            else:                rgb = (255, 255, 255)        else:            h = target_color_hex.lstrip('#')            rgb = tuple(int(h[i:i+2], 16) for i in (0, 2, 4))        r = int(rgb[0] * progress)        g = int(rgb[1] * progress)        b = int(rgb[2] * progress)        return f'#{r:02x}{g:02x}{b:02x}'    def update(self):        if self.game_over or self.game_won:            if self.breaking:                self.break_timer += 1                for frag in self.fragments:                    frag['vy'] += 0.3                    frag['x'] += frag['vx']                    frag['y'] += frag['vy']                    frag['alpha'] = max(0.0, 1.0 - self.break_timer / 30.0)            else:                pass         else:            self.on_ground = False            if self.is_charging:                if self.charge_power < self.MAX_CHARGE:                    self.charge_power += self.CHARGE_RATE            self.player['vy'] += self.GRAVITY            self.player['x'] += self.player['vx']            self.player['y'] += self.player['vy']            if self.elasticing:                self.elastic_timer += 1                if self.elastic_timer >= self.elastic_duration:                    self.elastic_timer = self.elastic_duration                    self.elasticing = False            player_bottom = self.player['y'] + self.player['h']            player_top = self.player['y']            player_left = self.player['x']            player_right = self.player['x'] + self.player['w']            prev_left = player_left - self.player['vx']            prev_right = player_right - self.player['vx']            prev_bottom = player_bottom - self.player['vy']            for p in self.platforms:                plat_top = p['y']                plat_left = p['x']                plat_right = p['x'] + p['w']                plat_bottom = p['y'] + p['h']                if player_right > plat_left and player_left < plat_right and player_bottom > plat_top and player_top < plat_bottom:                    if self.player['vy'] > 0 and prev_bottom <= plat_top:                        self.player['y'] = plat_top - self.player['h']                        self.player['vy'] = 0                        self.player['vx'] = 0                        self.on_ground = True                        break                    elif prev_right <= plat_left and player_right > plat_left:                        self.player['vx'] = 0                        self.player['vy'] = 0                        self.start_break_animation()                        self.breaking = True                        self.game_over = True                        break                    elif prev_left >= plat_right and player_left < plat_right:                        self.player['vx'] = 0                        self.player['vy'] = 0                        self.start_break_animation()                        self.breaking = True                        self.game_over = True                        break                    else:                        self.game_over = True                        break            if self.player['x'] > 1200:                self.game_won = True            if self.player['y'] > 500:                if not self.breaking:                    self.start_break_animation()                    self.breaking = True                self.game_over = True        if self.elasticing and self.elastic_timer >= self.elastic_duration:            self.elasticing = False        current_state = 'won' if self.game_won else ('over' if self.game_over else 'playing')        if current_state != self.game_state:            self.game_state = current_state            self.text_fade = 0.0        if self.text_fade < 1.0:            self.text_fade += 0.03             if self.text_fade > 1.0:                self.text_fade = 1.0        self.draw()    def draw(self):        self.canvas.delete("all")        for p in self.platforms:            self.canvas.create_rectangle(                p['x'], p['y'],                 p['x'] + p['w'], p['y'] + p['h'],                 fill="#222222", outline=""            )        if not self.breaking:            p = self.player            draw_w, draw_h = self._get_player_draw_dims()            draw_x = p['x'] - (draw_w - p['w']) / 2            draw_y = p['y'] + (p['h'] - draw_h)            self.canvas.create_rectangle(                draw_x, draw_y,                 draw_x + draw_w, draw_y + draw_h,                 fill="white", outline=""            )        if self.is_charging:            ratio = self.charge_power / self.MAX_CHARGE             bar_width = ratio * 40             if ratio <= 0.5:                local_ratio = ratio * 2                r = 255                 g = int(255 * (1 - local_ratio))                b = 0            else:                local_ratio = (ratio - 0.5) * 2                r = int(255 - (255 - 139) * local_ratio)                g = 0                 b = 0             color_hex = f'#{r:02x}{g:02x}{b:02x}'            self.canvas.create_rectangle(                p['x'], p['y'] - 10,                p['x'] + bar_width, p['y'] - 5,                fill=color_hex, outline=""            )        if self.breaking:            for frag in self.fragments:                alpha = int(frag['alpha'] * 255)                color = f"#{alpha:02x}{alpha:02x}{alpha:02x}"                self.canvas.create_rectangle(                    frag['x'], frag['y'],                    frag['x'] + frag['size'], frag['y'] + frag['size'],                    fill=color, outline=""                )        if self.game_over:            text_color = self._get_faded_color("red", self.text_fade)            self.canvas.create_text(580, 200, text="万物皆生,唯你独枯。茫茫天地间,竟全然无你托身之所……", fill=text_color, font=("STKaiti", 30))            text_color = self._get_faded_color("grey", self.text_fade)            self.canvas.create_text(90, 30, text="R: retry,  T: exit", fill=text_color, font=("times", 12))        elif self.game_won:            text_color = self._get_faded_color("#00ff00", self.text_fade)            self.canvas.create_text(450, 200, text="穿尽千山与万水,始知天地本来宽.", fill=text_color, font=("STKaiti", 30))            text_color = self._get_faded_color("grey", self.text_fade)            self.canvas.create_text(90, 30, text="R: retry,  T: exit", fill=text_color, font=("times", 12))        else:            text_color = self._get_faded_color("white", self.text_fade)            self.canvas.create_text(450, 70, text="正入万山圈子里,一山放过一山拦——", fill=text_color, font=("STKaiti", 20))    def _get_player_draw_dims(self):        base_w = self.player['w']        base_h = self.player['h']        if self.is_charging:            ratio = min(self.charge_power / self.MAX_CHARGE, 1.0)            return base_w + ratio * 18, base_h - ratio * 10        if self.elasticing:            progress = self.elastic_timer / self.elastic_duration            effect = math.sin(progress * math.pi)            scale_x = 1.0 + 0.16 * effect            scale_y = 1.0 - 0.16 * effect            return base_w * scale_x, base_h * scale_y        return base_w, base_h    def game_loop(self):        self.update()        self.top.after(20, self.game_loop)    def restart_game(self, event=None):        self.reset_game()    def close_game(self, event=None):        self.top.destroy()class OffWorkCountdownApp:    def __init__(self, root):        self.root = root         self.root.title("下班倒计时界面")        self.root.geometry("1030x430")        self.root.configure(bg=BG_COLOR)        self.title_font = (CHINESE_FONT, 18, "bold")        self.label_font = (CHINESE_FONT, 12)        self.time_font  = (CHINESE_FONT, 22, "bold")        self.btn_font   = (CHINESE_FONT, 11)        self.alarms = [            {"time": alarm_time, "enabled": True, "fired_date": None}            for alarm_time in DEFAULT_ALARMS        ]        self.alarm_reset_date = datetime.now().date()        self.alarm_volume = 70        self.alarm_message = DEFAULT_ALARM_MESSAGE        self.active_alarm = None        self.alarm_popup = None        self.alarm_stop_event = None        self.tray_icon = None        self.is_exiting = False        self.root.protocol("WM_DELETE_WINDOW", self.on_window_close)        self.root.bind("<Unmap>", self.on_window_minimize)        self.create_widgets()        self.update_time()        self.start_tray_icon()    def create_tray_image(self):        if Image is None or ImageDraw is None:            return None        image = Image.new("RGBA", (64, 64), (0, 0, 0, 0))        draw = ImageDraw.Draw(image)        draw.ellipse((5, 5, 59, 59), fill="#397a9b", outline="#ffdf6b", width=3)        draw.text((19, 13), "休", fill="#ffffff")        return image    def start_tray_icon(self):        if pystray is None:            return        tray_image = self.create_tray_image()        if tray_image is None:            return        try:            menu = pystray.Menu(                pystray.MenuItem("显示主界面", self.restore_from_tray, default=True),                pystray.MenuItem("退出程序", self.exit_from_tray),            )            self.tray_icon = pystray.Icon(                "off_work_countdown", tray_image, "下班倒计时", menu            )        except Exception:            self.tray_icon = None            return        threading.Thread(target=self.tray_icon.run, daemon=True).start()    def on_window_minimize(self, event=None):        if not self.is_exiting and self.root.state() == "iconic":            self.root.after(80, self.hide_to_tray)    def hide_to_tray(self):        if self.is_exiting:            return        if self.tray_icon is None:            self.show_main_window()            return        self.root.withdraw()    def on_window_close(self):        if self.tray_icon is None:            self.exit_application()        else:            self.hide_to_tray()    def restore_from_tray(self, icon=None, item=None):        self.root.after(0, self.show_main_window)    def show_main_window(self):        if self.is_exiting:            return        self.root.deiconify()        self.root.state("normal")        self.root.lift()        self.root.focus_force()    def exit_from_tray(self, icon=None, item=None):        self.root.after(0, self.exit_application)    def exit_application(self):        if self.is_exiting:            return        self.is_exiting = True        self.stop_alarm()        if self.tray_icon:            self.tray_icon.stop()        self.root.destroy()    def create_widgets(self):        main = tk.Frame(self.root, bg=BG_COLOR)        main.pack(fill="both", expand=True, padx=15, pady=10)        alarm_panel = tk.Frame(main, bg=BG_COLOR, width=230)        alarm_panel.pack(side="left", fill="y", padx=(0, 18))        alarm_panel.pack_propagate(False)        tk.Label(alarm_panel, text="休息提醒", font=self.title_font,             bg=BG_COLOR, fg=TITLE_COLOR).pack(pady=(0, 10), anchor="w")        self.alarm_list = tk.Frame(alarm_panel, bg=BG_COLOR)        self.alarm_list.pack(fill="both", expand=True)        RoundedButton(alarm_panel, text="⚙", font=(CHINESE_FONT, 17),              command=self.open_alarm_settings).pack(side="bottom", pady=(8, 0), anchor="w")        tk.Frame(main, width=2, bg=DIVIDER_COLOR).pack(side="left", fill="y", padx=(0, 18))        left = tk.Frame(main, bg=BG_COLOR)        left.pack(side="left", fill="both", expand=True, padx=(0, 18))        tk.Label(left, text="    ~下班倒计时~ ",                 font=self.title_font, bg=BG_COLOR, fg=TITLE_COLOR).pack(pady=(0, 20), anchor="w")        f1 = tk.Frame(left, bg=BG_COLOR)        f1.pack(pady=8, fill="x")        tk.Label(f1, text="离下班还有:", font=self.label_font,                 bg=BG_COLOR, fg=FG_COLOR).pack(anchor="w")        self.lbl_off_work = tk.Label(f1, text="计算中...", font=self.time_font,                                     bg=BG_COLOR, fg=ACCENT_RED)        self.lbl_off_work.pack(anchor="w", pady=(5, 0))        f2 = tk.Frame(left, bg=BG_COLOR)        f2.pack(pady=8, fill="x")        tk.Label(f2, text="离周末还有:", font=self.label_font,                 bg=BG_COLOR, fg=FG_COLOR).pack(anchor="w")        self.lbl_friday = tk.Label(f2, text="计算中...", font=self.time_font,                                   bg=BG_COLOR, fg=ACCENT_CYAN)        self.lbl_friday.pack(anchor="w", pady=(5, 0))        f3 = tk.Frame(left, bg=BG_COLOR)        f3.pack(pady=8, fill="x")        tk.Label(f3, text="离节假日还有:", font=self.label_font,                 bg=BG_COLOR, fg=FG_COLOR).pack(anchor="w")        self.lbl_holiday = tk.Label(f3, text="计算中...", font=(CHINESE_FONT, 16),                                    bg=BG_COLOR, fg=ACCENT_YELLOW)        self.lbl_holiday.pack(anchor="w", pady=(5, 0))        RoundedButton(left, text="⚙", font=(CHINESE_FONT, 17),                  command=self.open_settings).pack(side="bottom", pady=(8, 0), anchor="w")        tk.Frame(main, width=2, bg=DIVIDER_COLOR).pack(side="left", fill="y", padx=(0, 18))        right = tk.Frame(main, bg=BG_COLOR, width=390, height=390)        right.pack(side="right", fill="y")        right.pack_propagate(False)        mask = tk.Frame(right, bg=MASK_COLOR, width=360, height=370)        mask.place(relx=0.5, rely=0.5, anchor="center")        self.cat_img = None         if os.path.exists(CAT_IMAGE_PATH):            try:                self.cat_img = create_rounded_image(CAT_IMAGE_PATH, size=(320, 320), radius=10)                if self.cat_img:                    img_label = tk.Label(right, image=self.cat_img, bg=MASK_COLOR, bd=0, cursor="hand2")                    img_label.place(relx=0.5, rely=0.5, anchor="center")                    img_label.bind("<Button-1>", lambda e: self.open_game())                else:                    from PIL import Image, ImageTk                     img = Image.open(CAT_IMAGE_PATH)                    img = img.resize((320, 320), Image.LANCZOS)                    self.cat_img = ImageTk.PhotoImage(img)                    img_label = tk.Label(right, image=self.cat_img, bg=MASK_COLOR, bd=0, cursor="hand2")                    img_label.place(relx=0.5, rely=0.5, anchor="center")                    img_label.bind("<Button-1>", lambda e: self.open_game())            except ImportError:                tk.Label(right, text="(需安装Pillow才能显示图片哦)\npip install pillow",                         bg=MASK_COLOR, fg=FG_COLOR, font=(CHINESE_FONT, 11),                         justify="center").place(relx=0.5, rely=0.5, anchor="center")        else:            label = tk.Label(right, text="这里本该有只哈基米。点击进入游戏",                            bg=MASK_COLOR, fg=FG_COLOR, font=(CHINESE_FONT, 10),                            justify="center", cursor="hand2")            label.place(relx=0.5, rely=0.5, anchor="center")            label.bind("<Button-1>", lambda e: self.open_game())    def update_time(self):        global off_work_time_str         now = datetime.now()        self.reset_alarms_for_new_day(now)        self.check_alarms(now)        self.refresh_alarm_list(now)        if now.weekday() >= 5:            self.lbl_off_work.config(text="休息中", fg=ACCENT_CYAN)        else:            text, color = calculate_time_diff(off_work_time_str)            self.lbl_off_work.config(text=text, fg=color)        text, color = get_weekend_diff(off_work_time_str)        self.lbl_friday.config(text=text, fg=color)        days, name = get_next_holiday_info()        self.lbl_holiday.config(text=f"{days}天 ({name})")        self.root.after(1000, self.update_time)    def reset_alarms_for_new_day(self, now):        if now.date() == self.alarm_reset_date:            return        for alarm in self.alarms:            alarm["fired_date"] = None        self.alarm_reset_date = now.date()    def refresh_alarm_list(self, now=None):        now = now or datetime.now()        today = now.date()        for child in self.alarm_list.winfo_children():            child.destroy()        for alarm in self.alarms:            is_done = alarm["fired_date"] == today            color = "#666666" if is_done else (FG_COLOR if alarm["enabled"] else "#555555")            status = "已提醒" if is_done else ("开启" if alarm["enabled"] else "关闭")            row = tk.Frame(self.alarm_list, bg=BG_COLOR)            row.pack(fill="x", pady=2)            tk.Label(row, text=alarm["time"], width=7, anchor="w",                     font=(CHINESE_FONT, 14, "bold"), bg=BG_COLOR, fg=color).pack(side="left")            meal_label = ALARM_MEAL_LABELS.get(alarm["time"])            if meal_label:                tk.Label(row, text=meal_label, padx=5, pady=1,                         font=(CHINESE_FONT, 9), bg=BG_COLOR, fg=color,                         highlightthickness=1, highlightbackground=DIVIDER_COLOR,                         highlightcolor=DIVIDER_COLOR).pack(side="left", padx=(2, 0))            tk.Label(row, text=status, width=6, anchor="e",                     font=(CHINESE_FONT, 9), bg=BG_COLOR, fg=color).pack(side="right")    def check_alarms(self, now):        current_time = now.strftime("%H:%M")        for index, alarm in enumerate(self.alarms):            if (alarm["enabled"] and alarm["time"] == current_time                    and alarm["fired_date"] != now.date()):                alarm["fired_date"] = now.date()                self.start_alarm(index)    def start_alarm(self, index):        if self.active_alarm is not None:            return        self.active_alarm = index        self.alarm_stop_event = threading.Event()        threading.Thread(target=self.play_alarm_sound, args=(self.alarm_stop_event,), daemon=True).start()        self.show_alarm_popup()    def play_alarm_sound(self, stop_event):        if winsound is None:            return        wav_path = os.path.join(tempfile.gettempdir(), "rest_alarm.wav")        try:            sample_rate = 44100            duration = 0.5            frequency = 880            amplitude = int(32767 * max(0, min(100, self.alarm_volume)) / 100)            with wave.open(wav_path, "w") as audio:                audio.setnchannels(1)                audio.setsampwidth(2)                audio.setframerate(sample_rate)                frames = bytearray()                for sample in range(int(sample_rate * duration)):                    value = int(amplitude * math.sin(2 * math.pi * frequency * sample / sample_rate))                    frames.extend(struct.pack("<h", value))                audio.writeframes(frames)            end_time = time.time() + 40            while time.time() < end_time and not stop_event.is_set():                winsound.PlaySound(wav_path, winsound.SND_FILENAME)        except Exception as error:            print(f"播放提醒音失败: {error}")    def show_alarm_popup(self):        if self.alarm_popup and self.alarm_popup.winfo_exists():            return        popup = tk.Toplevel(self.root)        self.alarm_popup = popup        transparent_color = "#010101"        popup.overrideredirect(True)        popup_width = 1000        popup_height = 260        popup.geometry("{}x{}+{}+{}".format(            popup_width, popup_height,            max((popup.winfo_screenwidth() - popup_width) // 2, 0),            max((popup.winfo_screenheight() - popup_height) // 2, 0)))        popup.configure(bg=transparent_color)        popup.attributes("-topmost", True)        popup.protocol("WM_DELETE_WINDOW", self.stop_alarm)        try:            popup.attributes("-transparentcolor", transparent_color)        except tk.TclError:            pass        message = self.alarm_message.rstrip("!!") + "!"        canvas = tk.Canvas(popup, bg=transparent_color, highlightthickness=0,                           width=popup_width, height=popup_height, cursor="hand2")        canvas.pack(fill="both", expand=True)        canvas.bind("<Button-1>", lambda event: self.close_alarm_by_text(canvas, event))        self.draw_alarm_text(canvas, message, 0)        popup.after(40000, self.stop_alarm)    def close_alarm_by_text(self, canvas, event):        text_items = canvas.find_withtag("alarm-text")        for text_item in text_items:            text_box = canvas.bbox(text_item)            if text_box and text_box[0] <= event.x <= text_box[2] and text_box[1] <= event.y <= text_box[3]:                self.stop_alarm()                return    def draw_alarm_text(self, canvas, message, frame):        if not self.alarm_popup or not self.alarm_popup.winfo_exists():            return        canvas.delete("all")        width = max(canvas.winfo_width(), 1000)        height = max(canvas.winfo_height(), 260)        text_specs = [            (0.14, 0.18, "#ff2020", 28, 4, 0),            (0.50, 0.16, "#ff4d4d", 42, 7, 1),            (0.86, 0.20, "#dc143c", 24, 5, 0),            (0.10, 0.76, "#ff3333", 38, 9, 1),            (0.50, 0.84, "#ff6666", 30, 6, 0),            (0.89, 0.73, "#b22222", 46, 11, 1),        ]        for x_ratio, y_ratio, color, size, blink_period, blink_phase in text_specs:            if (frame // blink_period + blink_phase) % 2 == 0:                canvas.create_text(                    width * x_ratio, height * y_ratio, text=message,                    fill=color, font=(CHINESE_FONT, size, "bold"),                    tags="alarm-text")        self.alarm_popup.after(80, self.draw_alarm_text,                               canvas, message, frame + 1)    def stop_alarm(self):        if self.alarm_stop_event:            self.alarm_stop_event.set()        if self.alarm_popup and self.alarm_popup.winfo_exists():            self.alarm_popup.destroy()        self.alarm_popup = None        self.active_alarm = None    def open_alarm_settings(self):        top = tk.Toplevel(self.root)        top.title("休息提醒设置")        top.geometry("560x560")        top.minsize(560, 560)        top.resizable(False, False)        top.configure(bg=POPUP_BG)        top.transient(self.root)        tk.Label(top, text="闹铃时间、开关和提醒文案",             bg=POPUP_BG, fg=TITLE_COLOR, font=(CHINESE_FONT, 16, "bold")).pack(pady=(10, 5))        header = tk.Frame(top, bg=POPUP_BG)        header.pack(fill="x", padx=22)        for text, width in (("时间", 12), ("开启", 8), ("状态", 10)):            tk.Label(header, text=text, width=width, anchor="w", bg=POPUP_BG,                     fg=FG_COLOR, font=self.label_font).pack(side="left")        rows = []        for alarm in self.alarms:            row = tk.Frame(top, bg=POPUP_BG)            row.pack(fill="x", padx=22, pady=1)            time_var = tk.StringVar(value=alarm["time"])            enabled_var = tk.BooleanVar(value=alarm["enabled"])            tk.Entry(row, textvariable=time_var, width=10, justify="center",                     bg="#3c3f41", fg="white", insertbackground="white").pack(side="left", padx=(0, 18))            tk.Checkbutton(row, variable=enabled_var, bg=POPUP_BG, activebackground=POPUP_BG,                           selectcolor="#3c3f41").pack(side="left", padx=(0, 28))            tk.Label(row, text="HH:MM", bg=POPUP_BG, fg="#888888").pack(side="left")            rows.append((alarm, time_var, enabled_var))        message_frame = tk.Frame(top, bg=POPUP_BG)        message_frame.pack(fill="x", padx=22, pady=(10, 3))        tk.Label(message_frame, text="显示字样", bg=POPUP_BG, fg=FG_COLOR).pack(side="left")        message_var = tk.StringVar(value=self.alarm_message)        tk.Entry(message_frame, textvariable=message_var, width=34,                 bg="#3c3f41", fg="white", insertbackground="white").pack(side="left", padx=12)        volume_frame = tk.Frame(top, bg=POPUP_BG)        volume_frame.pack(fill="x", padx=22, pady=2)        tk.Label(volume_frame, text="闹铃响度", bg=POPUP_BG, fg=FG_COLOR).pack(side="left")        volume_var = tk.IntVar(value=self.alarm_volume)        tk.Scale(volume_frame, from_=0, to=100, variable=volume_var, orient="horizontal",                 length=300, bg=POPUP_BG, fg=FG_COLOR, troughcolor="#3c3f41",                 highlightthickness=0).pack(side="left", padx=12)        def save_alarm_settings():            for alarm, time_var, enabled_var in rows:                try:                    hour, minute = map(int, time_var.get().strip().split(":"))                    if not (0 <= hour < 24 and 0 <= minute < 60):                        raise ValueError                except ValueError:                    messagebox.showerror("错误", "闹铃时间请使用 HH:MM 格式。", parent=top)                    return                alarm["time"] = f"{hour:02d}:{minute:02d}"                alarm["enabled"] = enabled_var.get()            self.alarm_volume = volume_var.get()            self.alarm_message = message_var.get().strip() or DEFAULT_ALARM_MESSAGE            self.refresh_alarm_list()            top.destroy()        tk.Button(top, text="保存设置", command=save_alarm_settings,                  bg=BUTTON_COLOR, fg=BUTTON_TEXT, font=self.label_font,              relief="flat").pack(pady=10)    def open_settings(self):        top = tk.Toplevel(self.root)        top.title("设置")        top.geometry("320x160")        top.configure(bg=POPUP_BG)        tk.Label(top, text="请输入下班时间 (HH:MM:SS):",                 bg=POPUP_BG, fg=FG_COLOR, font=(CHINESE_FONT, 10)).pack(pady=15)        entry = tk.Entry(top, font=(CHINESE_FONT, 12), justify="center",                         bg="#3c3f41", fg="white", insertbackground="white")        entry.insert(0, off_work_time_str)        entry.pack(pady=5)        entry.focus_set()        def save():            global off_work_time_str             new_time = entry.get()            try:                h, m, s = map(int, new_time.split(':'))                if 0 <= h < 24 and 0 <= m < 60 and 0 <= s < 60:                    off_work_time_str = new_time                     messagebox.showinfo("成功", "下班时间已更新!")                    top.destroy()                else:                    messagebox.showerror("错误", "时间数值不合法!")            except Exception:                messagebox.showerror("错误", "格式错误,请使用 HH:MM:SS")        tk.Button(top, text="确定", command=save,                  bg=BUTTON_COLOR, fg=BUTTON_TEXT, font=(CHINESE_FONT, 10),                  relief="flat").pack(pady=15)    def open_game(self):        MiniGameApp(self.root)if __name__ == "__main__":    root = tk.Tk()    app = OffWorkCountdownApp(root)    root.mainloop()

往期:

一文速通LSTM:MATLAB极简算例(附代码 )

【评价类算法算例】以浙江11座地级市为例

一文速通决策树和随机森林算法(Matlab实战算例)

PINN+CFD简版综述(物理信息神经网络应用于计算流体力学)

五种机器学习模型(强行)解决实际问题+代码

工程优化万能思路:神经网络代理模型&智能优化算法

有限元法六结点三角形单元MATLAB核心代码

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