fix(accounting): billing.dspy — keep page in ns for Tabular paging, extract DictObject correctly

This commit is contained in:
yumoqing 2026-07-17 14:48:07 +08:00
parent 4ef0808004
commit 9a6723378b

View File

@ -12,6 +12,8 @@ ns = {
'orgid': userorgid, 'orgid': userorgid,
'start_date': start_date, 'start_date': start_date,
'end_date': end_date, 'end_date': end_date,
'page': int(params_kw.get('page', 1)),
'rows': int(params_kw.get('rows', 60)),
'sort': 'acc_date desc' 'sort': 'acc_date desc'
} }
@ -48,8 +50,8 @@ where a.orgid = ${orgid}$
'credit_sum': float(stats_recs[0].credit_sum) if stats_recs else 0 'credit_sum': float(stats_recs[0].credit_sum) if stats_recs else 0
} }
result = { result = {
'total': len(rows), 'total': rows.total if not isinstance(rows, list) else len(rows),
'rows': rows, 'rows': rows.rows if not isinstance(rows, list) else rows,
'stats': stats 'stats': stats
} }
return json.dumps(result, ensure_ascii=False, default=str) return json.dumps(result, ensure_ascii=False, default=str)