diff --git a/wwwroot/billing.dspy b/wwwroot/billing.dspy index e8dce7f..2d9b86f 100644 --- a/wwwroot/billing.dspy +++ b/wwwroot/billing.dspy @@ -12,6 +12,8 @@ ns = { 'orgid': userorgid, 'start_date': start_date, 'end_date': end_date, + 'page': int(params_kw.get('page', 1)), + 'rows': int(params_kw.get('rows', 60)), '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 } result = { - 'total': len(rows), - 'rows': rows, + 'total': rows.total if not isinstance(rows, list) else len(rows), + 'rows': rows.rows if not isinstance(rows, list) else rows, 'stats': stats } return json.dumps(result, ensure_ascii=False, default=str)