36 lines
2.0 KiB
Python
36 lines
2.0 KiB
Python
import sys
|
|
sys.path.insert(0, '.')
|
|
from lib.db import execute_query
|
|
|
|
print('=== 检查最近的340路历史记录 ===')
|
|
history = execute_query('SELECT id, report_date, start_time, end_time, total_orders, sum_results, status FROM t_daily_report_history WHERE config_id = %s ORDER BY report_date DESC LIMIT 5', (1784534746013,))
|
|
for h in history:
|
|
print(f"ID: {h['id']}")
|
|
print(f" 报表日期: {h['report_date']}")
|
|
print(f" 开始时间: {h['start_time']}")
|
|
print(f" 结束时间: {h['end_time']}")
|
|
print(f" 订单数: {h['total_orders']}")
|
|
print(f" 状态: {h['status']}")
|
|
print(f" 求和结果: {h['sum_results'][:100]}...")
|
|
print()
|
|
|
|
print('=== 检查7月23日是否有报表生成 ===')
|
|
history_23 = execute_query('SELECT id, report_date, start_time, end_time, total_orders, status FROM t_daily_report_history WHERE config_id = %s AND report_date = %s', (1784534746013, '2026-07-23'))
|
|
for h in history_23:
|
|
print(f"ID: {h['id']}, 报表日期: {h['report_date']}, 状态: {h['status']}, 订单数: {h['total_orders']}")
|
|
print(f" 开始时间: {h['start_time']}, 结束时间: {h['end_time']}")
|
|
|
|
print('\n=== 检查7月14日是否有自动采集的数据 ===')
|
|
auto_14 = execute_query('SELECT * FROM t_daily_report_sum_data WHERE report_date = %s AND split_value = %s AND data_source = %s', ('2026-07-14', '163425', 'auto'))
|
|
print(f"7月14日自动采集数据: {len(auto_14)}条")
|
|
|
|
print('\n=== 检查7月15日是否有自动采集的数据 ===')
|
|
auto_15 = execute_query('SELECT * FROM t_daily_report_sum_data WHERE report_date = %s AND split_value = %s AND data_source = %s', ('2026-07-15', '163425', 'auto'))
|
|
print(f"7月15日自动采集数据: {len(auto_15)}条")
|
|
|
|
print('\n=== 查询7月23日的求和数据 ===')
|
|
sum_23 = execute_query('SELECT * FROM t_daily_report_sum_data WHERE report_date = %s AND split_value = %s', ('2026-07-23', '163425'))
|
|
print(f"7月23日求和数据: {len(sum_23)}条")
|
|
for s in sum_23:
|
|
print(f" ID: {s['id']}, 字段: {s['sum_field_key']}, 值: {s['sum_value']}, 来源: {s['data_source']}")
|