1,修复驿来特没有数据,只特来电有,不生成报表的问题。

2,增加历史记录,每页显示多少条的功能。
This commit is contained in:
2026-07-21 13:30:04 +08:00
parent 404450b779
commit d2ba256889
4 changed files with 96 additions and 31 deletions

View File

@@ -53,7 +53,8 @@ def get_report_history():
page_size = int(request.args.get('page_size', 20))
start_date = request.args.get('start_date')
end_date = request.args.get('end_date')
log_info(f'[报表API] 获取历史记录,第{page}页,日期范围: {start_date or "开始"} ~ {end_date or "结束"}', 'api')
status = request.args.get('status')
log_info(f'[报表API] 获取历史记录,第{page}页,状态: {status or "全部"},日期范围: {start_date or "开始"} ~ {end_date or "结束"}', 'api')
offset = (page - 1) * page_size
@@ -69,6 +70,10 @@ def get_report_history():
where_clauses.append('DATE(end_time) <= %s')
params.append(end_date)
if status is not None and status != '':
where_clauses.append('status = %s')
params.append(int(status))
where_sql = ' AND '.join(where_clauses) if where_clauses else '1=1'
# 查询总数