From 2bd45f8654d82cdf137f618c1297cc5ad780081f Mon Sep 17 00:00:00 2001 From: XingQue Date: Thu, 25 Jun 2026 16:11:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=AF=E5=88=86=E5=A4=84=E7=BD=9A?= =?UTF-8?q?=E4=BF=B1=E4=B9=90=E9=83=A8=E8=BF=87=E6=BB=A4=E4=B8=8E=20create?= =?UTF-8?q?=5Ftime=EF=BC=9B=E8=8F=9C=E5=8D=95=E5=A2=9E=E5=8A=A0=E6=8F=90?= =?UTF-8?q?=E7=8E=B0/=E5=A4=84=E7=BD=9A=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jituan/management/commands/seed_kefu_menu.py | 8 ++++++-- jituan/services/club_penalty.py | 7 +++++-- users/views.py | 10 +++++++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/jituan/management/commands/seed_kefu_menu.py b/jituan/management/commands/seed_kefu_menu.py index 5571cab..de8c90b 100644 --- a/jituan/management/commands/seed_kefu_menu.py +++ b/jituan/management/commands/seed_kefu_menu.py @@ -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, diff --git a/jituan/services/club_penalty.py b/jituan/services/club_penalty.py index 0b4caf1..4d6ead0 100644 --- a/jituan/services/club_penalty.py +++ b/jituan/services/club_penalty.py @@ -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)) diff --git a/users/views.py b/users/views.py index e57c13b..9195804 100644 --- a/users/views.py +++ b/users/views.py @@ -9050,15 +9050,19 @@ class KefuPunishmentListView(APIView): # 6. 构建返回列表 list_data = [] for item in records: + ct = item.CreateTime + ut = item.UpdateTime list_data.append({ 'dingdan_id': item.OrderID, 'dashouid': item.PlayerID, 'qingqiuid': item.ApplicantID, 'cfliyou': item.PenaltyReason, 'sqzhuangtai': item.ApplyStatus, - 'CreateTime': item.CreateTime, - 'UpdateTime': item.UpdateTime, - # 其他字段按需添加 + 'jifen': item.DeductedPoints, + 'CreateTime': ct, + 'UpdateTime': ut, + 'create_time': ct.isoformat() if ct else '', + 'update_time': ut.isoformat() if ut else '', }) return Response({