更新2025年12月12日的数据

This commit is contained in:
2025-12-12 21:03:55 +08:00
parent 1693c1963f
commit 272f4440fd
10 changed files with 31063 additions and 1 deletions

Binary file not shown.

View File

@@ -137,11 +137,34 @@ class SQLiteWebViewer:
cursor.execute(count_query, query_params)
total_count = cursor.fetchone()[0]
# 检查是否有日期相关字段,用于排序
date_columns = []
# 常见的日期字段名称
date_field_names = ['created_at', 'updated_at', 'date', 'publish_date', 'release_date']
for col_info in columns_info:
field_name = col_info[1]
# 检查字段名是否包含日期相关关键词
if any(keyword in field_name.lower() for keyword in date_field_names):
date_columns.append(field_name)
# 如果找到日期字段,按最新日期排序
order_by_clause = ""
if date_columns:
# 优先使用updated_at如果没有则使用created_at否则使用第一个找到的日期字段
if 'updated_at' in date_columns:
sort_column = 'updated_at'
elif 'created_at' in date_columns:
sort_column = 'created_at'
else:
sort_column = date_columns[0]
order_by_clause = f" ORDER BY {sort_column} DESC"
logger.info(f"应用日期排序: {sort_column} DESC")
# 获取分页数据
offset = (page - 1) * per_page
query_params.extend([per_page, offset])
data_query = f"SELECT * FROM {table_name}{where_clause} LIMIT ? OFFSET ?"
data_query = f"SELECT * FROM {table_name}{where_clause}{order_by_clause} LIMIT ? OFFSET ?"
cursor.execute(data_query, query_params)
rows = cursor.fetchall()