fix: 积分处罚俱乐部过滤与 create_time;菜单增加提现/处罚详情
This commit is contained in:
@@ -51,9 +51,11 @@ MENU_ROWS = [
|
||||
{'page_id': 'withdraw', 'name': '提现管理', 'path': '', 'parent_id': '', 'sort_order': 60},
|
||||
{'page_id': 'withdraw.audit', 'name': '提现审核', 'path': '/withdraw/audit', 'parent_id': 'withdraw', 'sort_order': 61,
|
||||
'perm_codes': ['005bb']},
|
||||
{'page_id': 'withdraw.data', 'name': '提现数据', 'path': '/withdraw/data', 'parent_id': 'withdraw', 'sort_order': 62,
|
||||
{'page_id': 'withdraw.detail', 'name': '提现详情', 'path': '/withdraw/detail', 'parent_id': 'withdraw', 'sort_order': 62,
|
||||
'perm_codes': ['005bb']},
|
||||
{'page_id': 'withdraw.settings', 'name': '提现设置', 'path': '/withdraw/settings', 'parent_id': 'withdraw', 'sort_order': 63,
|
||||
{'page_id': 'withdraw.data', 'name': '提现数据', 'path': '/withdraw/data', 'parent_id': 'withdraw', 'sort_order': 63,
|
||||
'perm_codes': ['005bb']},
|
||||
{'page_id': 'withdraw.settings', 'name': '提现设置', 'path': '/withdraw/settings', 'parent_id': 'withdraw', 'sort_order': 64,
|
||||
'perm_codes': ['5500a', '5500b', '5500c']},
|
||||
# 管理员
|
||||
{'page_id': 'admin', 'name': '管理员管理', 'path': '', 'parent_id': '', 'sort_order': 70},
|
||||
@@ -70,6 +72,8 @@ MENU_ROWS = [
|
||||
# 处罚
|
||||
{'page_id': 'punishment', 'name': '处罚管理', 'path': '/punishment', 'parent_id': '', 'sort_order': 80,
|
||||
'perm_codes': ['005aa', '66693a', '66693b', '66693c', '66694c', '99933abs']},
|
||||
{'page_id': 'punishment.detail', 'name': '积分处罚详情', 'path': '/punishment/detail', 'parent_id': 'punishment', 'sort_order': 81,
|
||||
'perm_codes': ['005aa', '66693a', '66693b', '66693c', '66694c', '99933abs']},
|
||||
# 商品
|
||||
{'page_id': 'product', 'name': '商品管理', 'path': '', 'parent_id': '', 'sort_order': 90},
|
||||
{'page_id': 'product.list', 'name': '商品列表', 'path': '/product/list', 'parent_id': 'product', 'sort_order': 91,
|
||||
|
||||
@@ -92,11 +92,14 @@ def filter_penalty_record_qs(qs, request):
|
||||
if resolve_club_scope(request) == DATA_SCOPE_ALL:
|
||||
return qs
|
||||
club_id = resolve_club_id_from_request(request)
|
||||
if hasattr(qs.model, 'ClubID'):
|
||||
return qs.filter(ClubID=club_id)
|
||||
from django.db.models import Q
|
||||
from orders.models import Order
|
||||
from users.business_models import User
|
||||
user_ids = User.query.filter(ClubID=club_id).values_list('UserUID', flat=True)
|
||||
order_ids = Order.query.filter(ClubID=club_id).values_list('OrderID', flat=True)
|
||||
# ClubID 命中,或历史数据 club_id 未回填时按打手/订单归属俱乐部
|
||||
if hasattr(qs.model, 'ClubID'):
|
||||
return qs.filter(
|
||||
Q(ClubID=club_id) | Q(PlayerID__in=user_ids) | Q(OrderID__in=order_ids)
|
||||
)
|
||||
return qs.filter(Q(PlayerID__in=user_ids) | Q(OrderID__in=order_ids))
|
||||
|
||||
Reference in New Issue
Block a user