fix: 会员永久分红生效,管事/组长分红配置按俱乐部读取

This commit is contained in:
XingQue
2026-06-26 02:22:44 +08:00
parent d25c2dd862
commit f6b99f96a4
2 changed files with 28 additions and 5 deletions

View File

@@ -227,6 +227,14 @@ def calc_guanshi_member_fenhong(huiyuan_id, guanshi_id, cishu, club_id, default_
if cishu == 1:
base = default_guanshi_fc if default_guanshi_fc is not None else Decimal('0')
return base if base > 0 else None
try:
guanshi = UserGuanshi.query.get(user__UserUID=guanshi_id)
if guanshi.fenghong_erci_enabled:
permanent = Decimal(str(guanshi.fenghong_erci or 0))
if permanent > 0:
return permanent
except UserGuanshi.DoesNotExist:
pass
return None
@@ -240,6 +248,14 @@ def calc_zuzhang_member_fenhong(huiyuan_id, zuzhang_id, cishu, club_id, default_
if cishu == 1:
base = default_zuzhang_fc if default_zuzhang_fc is not None else Decimal('0')
return base if base > 0 else None
try:
zuzhang = UserZuzhang.query.get(user__UserUID=zuzhang_id)
if zuzhang.kaioi_ewai_fenhong:
permanent = Decimal(str(zuzhang.ewai_fenhong_jine or 0))
if permanent > 0:
return permanent
except UserZuzhang.DoesNotExist:
pass
return None