Files
Django/gongdan/management/commands/seed_gongdan_withdraw_block.py
XingQue 890e465e40 feat: 投诉工单正规化(介入/牵连提现拦截,仅俱乐部开关)
支持被投诉对象、平台介入、协商中状态与组长投诉;提现硬拦含管事向上牵连组长,默认仅 lxs 开启。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 00:50:31 +08:00

25 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""种子:俱乐部工单提现拦截开关。默认仅 lxs 打开。"""
from django.core.management.base import BaseCommand
from gongdan.services import ensure_club_gongdan_config
class Command(BaseCommand):
help = '初始化俱乐部工单配置complaint_withdraw_block'
def add_arguments(self, parser):
parser.add_argument('--club-id', default='lxs', help='俱乐部 ID默认 lxs')
parser.add_argument('--enable', action='store_true', default=True, help='打开提现拦截')
parser.add_argument('--disable', action='store_true', help='关闭提现拦截')
def handle(self, *args, **options):
club_id = (options.get('club_id') or 'lxs').strip()
enable = not options.get('disable')
row = ensure_club_gongdan_config(club_id, withdraw_block=enable)
if row.complaint_withdraw_block != enable:
row.complaint_withdraw_block = enable
row.save(update_fields=['complaint_withdraw_block', 'UpdateTime'])
self.stdout.write(self.style.SUCCESS(
f'club={club_id} complaint_withdraw_block={row.complaint_withdraw_block}'
))