chore: auto release commit (2026-09-11 16:25:24)
All checks were successful
技能自动化发布 / release (push) Successful in 6s
All checks were successful
技能自动化发布 / release (push) Successful in 6s
This commit is contained in:
@@ -157,6 +157,22 @@ def delete_todo(todo_id: int) -> bool:
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def get_current_remind_todos() -> list[Todo]:
|
||||
"""获取当前需要提醒的待办。"""
|
||||
now = _now()
|
||||
conn = get_conn()
|
||||
try:
|
||||
cur = conn.cursor()
|
||||
cur.execute(
|
||||
"SELECT id, title, status, priority, due_at, created_at, updated_at "
|
||||
"FROM todos WHERE due_at <= ? AND status = ?",
|
||||
(int(now / 60) * 60 + 59, STATUS_PENDING),
|
||||
)
|
||||
rows = cur.fetchall()
|
||||
return [Todo(*row) for row in rows]
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
|
||||
def stats() -> dict:
|
||||
"""简单统计:用于 ``todo stats`` 命令与 demo 报告。"""
|
||||
|
||||
Reference in New Issue
Block a user