diff --git a/src/api/project_routes.py b/src/api/project_routes.py index 1c0ec95..04e8150 100644 --- a/src/api/project_routes.py +++ b/src/api/project_routes.py @@ -32,7 +32,7 @@ async def list_projects(): try: conn = sqlite3.connect(str(db_path), timeout=5) total = conn.execute("SELECT COUNT(*) FROM tasks WHERE status != 'cancelled'").fetchone()[0] - active = conn.execute("SELECT COUNT(*) FROM tasks WHERE status NOT IN ('cancelled','done') AND COALESCE(archived,0)=0").fetchone()[0] + active = conn.execute("SELECT COUNT(*) FROM tasks WHERE COALESCE(archived,0)=0").fetchone()[0] archived = total - active conn.close() info['task_count'] = active @@ -46,7 +46,7 @@ async def list_projects(): try: conn = sqlite3.connect(str(general_db), timeout=5) total = conn.execute("SELECT COUNT(*) FROM tasks WHERE status != 'cancelled'").fetchone()[0] - active = conn.execute("SELECT COUNT(*) FROM tasks WHERE status NOT IN ('cancelled','done') AND COALESCE(archived,0)=0").fetchone()[0] + active = conn.execute("SELECT COUNT(*) FROM tasks WHERE COALESCE(archived,0)=0").fetchone()[0] conn.close() projects["_general"] = { "id": "_general", "name": "一般任务", "description": "无项目归属的通用任务", @@ -61,7 +61,7 @@ async def list_projects(): try: conn = sqlite3.connect(str(general_db_check), timeout=5) total = conn.execute("SELECT COUNT(*) FROM tasks WHERE status != 'cancelled'").fetchone()[0] - active = conn.execute("SELECT COUNT(*) FROM tasks WHERE status NOT IN ('cancelled','done') AND COALESCE(archived,0)=0").fetchone()[0] + active = conn.execute("SELECT COUNT(*) FROM tasks WHERE COALESCE(archived,0)=0").fetchone()[0] conn.close() projects["_general"]["task_count"] = active projects["_general"]["task_count_total"] = total