fix: 充值投诉仅允许已支付流水(前后端硬拦)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-27 01:12:30 +08:00
parent 332fde50a3
commit 97040c552e
2 changed files with 18 additions and 1 deletions

View File

@@ -330,6 +330,15 @@ class ChongzhiRecordListView(APIView):
leixing = request.data.get('leixing')
if leixing not in (None, ''):
qs = qs.filter(leixing=int(leixing))
# 投诉选单:仅已支付;普通充值记录页不传此参数则展示全部状态
only_paid = str(
request.data.get('only_paid')
or request.data.get('for_complaint')
or ''
).lower() in ('1', 'true', 'yes')
if only_paid:
from products.czjilu_types import CZJILU_PAID_STATUS
qs = qs.filter(zhuangtai=CZJILU_PAID_STATUS)
total = qs.count()
start = max(page - 1, 0) * page_size
type_map = {