parent
7dd0e4093a
commit
4a6a98ea9e
@ -174,7 +174,7 @@ def list_all_devices_admin(request):
|
||||
|
||||
page = int(request.GET.get('page', 1))
|
||||
page_size = int(request.GET.get('page_size', 20))
|
||||
start = page * page_size
|
||||
start = (page - 1) * page_size
|
||||
total = qs.count()
|
||||
items = [_serialize_device(d) for d in qs[start:start + page_size]]
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ class PaymentService:
|
||||
Returns:
|
||||
Decimal: 退款金额
|
||||
"""
|
||||
if refund_ratio < 0:
|
||||
if not (0 < refund_ratio <= 1):
|
||||
raise ValueError(f'退款比例不能为负数: refund_ratio={refund_ratio}')
|
||||
|
||||
amount = Decimal(str(paid_amount)) * Decimal(str(refund_ratio))
|
||||
|
||||
@ -101,6 +101,6 @@ class UserService:
|
||||
qs = qs.filter(phone__contains=phone)
|
||||
if nickname:
|
||||
qs = qs.filter(nickname__contains=nickname)
|
||||
if is_active:
|
||||
if is_active is not None:
|
||||
qs = qs.filter(is_active=is_active)
|
||||
return qs
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user