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