From 7a6d804cfa9a56f005ee5681b1742ab76dee91e0 Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Sun, 11 Oct 2026 10:08:40 +0800 Subject: [PATCH] fix: honor order numbers in protocol workflow lists. --- backend/app/crud/collection_protocol.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/app/crud/collection_protocol.py b/backend/app/crud/collection_protocol.py index 5c3211b5..e8729810 100644 --- a/backend/app/crud/collection_protocol.py +++ b/backend/app/crud/collection_protocol.py @@ -1507,7 +1507,10 @@ def list_audits( page = max(1, page) page_size = min(max(1, page_size), 100) rows = ( - q_base.order_by(BizProtocolAudit.create_time.desc()) + q_base.order_by( + BizProtocolAudit.order_num.asc(), + BizProtocolAudit.create_time.desc(), + ) .offset((page - 1) * page_size) .limit(page_size) .all() @@ -1682,7 +1685,10 @@ def list_receipt_confirm_details( page = max(1, page) page_size = min(max(1, page_size), 100) rows = ( - q_base.order_by(BizProtocolPaymentDetail.create_time.desc()) + q_base.order_by( + BizProtocolPaymentDetail.order_num.asc(), + BizProtocolPaymentDetail.create_time.desc(), + ) .offset((page - 1) * page_size) .limit(page_size) .all() @@ -1835,7 +1841,10 @@ def list_refund_confirm_details( page = max(1, page) page_size = min(max(1, page_size), 100) rows = ( - q_base.order_by(BizProtocolPaymentDetail.create_time.desc()) + q_base.order_by( + BizProtocolPaymentDetail.order_num.asc(), + BizProtocolPaymentDetail.create_time.desc(), + ) .offset((page - 1) * page_size) .limit(page_size) .all()