fix: 会员永久分红生效,管事/组长分红配置按俱乐部读取
This commit is contained in:
@@ -3205,9 +3205,12 @@ class GetGuanliDetailView(APIView):
|
|||||||
m['jiage'] = str(m['jiage'])
|
m['jiage'] = str(m['jiage'])
|
||||||
m['guanshifc'] = str(m['guanshifc'])
|
m['guanshifc'] = str(m['guanshifc'])
|
||||||
|
|
||||||
# 获取多次分红配置(按次数和会员组织)
|
# 获取多次分红配置(按次数和会员组织,按俱乐部隔离)
|
||||||
# 查询该管事的所有多次分红记录
|
from jituan.services.club_penalty import resolve_gsfenhong_club_id
|
||||||
duoci_records = DuociFenhong.query.filter(yonghuid=yonghuid).order_by('cishu')
|
guanshi_club = resolve_gsfenhong_club_id(dashouid=yonghuid)
|
||||||
|
duoci_records = DuociFenhong.query.filter(
|
||||||
|
yonghuid=yonghuid, club_id=guanshi_club,
|
||||||
|
).order_by('cishu')
|
||||||
custom_first = {} # 首次分红定制(cishu=1)
|
custom_first = {} # 首次分红定制(cishu=1)
|
||||||
extra_map = {} # 其他次数 { cishu: { huiyuan_id: { guanshi_fenhong, jieshao, jiage } } }
|
extra_map = {} # 其他次数 { cishu: { huiyuan_id: { guanshi_fenhong, jieshao, jiage } } }
|
||||||
|
|
||||||
@@ -3947,8 +3950,12 @@ class GetZuzhangDetailView(APIView):
|
|||||||
m['jiage'] = str(m['jiage'])
|
m['jiage'] = str(m['jiage'])
|
||||||
m['zuzhangfc'] = str(m['zuzhangfc'])
|
m['zuzhangfc'] = str(m['zuzhangfc'])
|
||||||
|
|
||||||
# 获取多次分红配置(按次数和会员组织)
|
# 获取多次分红配置(按次数和会员组织,按俱乐部隔离)
|
||||||
duoci_records = DuociFenhong.query.filter(yonghuid=yonghuid).order_by('cishu')
|
from jituan.services.club_penalty import resolve_gsfenhong_club_id
|
||||||
|
zuzhang_club = resolve_gsfenhong_club_id(dashouid=yonghuid)
|
||||||
|
duoci_records = DuociFenhong.query.filter(
|
||||||
|
yonghuid=yonghuid, club_id=zuzhang_club,
|
||||||
|
).order_by('cishu')
|
||||||
custom_first = {} # 首次分红定制(cishu=1)
|
custom_first = {} # 首次分红定制(cishu=1)
|
||||||
extra_map = {} # 其他次数 { cishu: { huiyuan_id: { zuzhang_fenhong, jieshao, jiage } } }
|
extra_map = {} # 其他次数 { cishu: { huiyuan_id: { zuzhang_fenhong, jieshao, jiage } } }
|
||||||
|
|
||||||
|
|||||||
@@ -227,6 +227,14 @@ def calc_guanshi_member_fenhong(huiyuan_id, guanshi_id, cishu, club_id, default_
|
|||||||
if cishu == 1:
|
if cishu == 1:
|
||||||
base = default_guanshi_fc if default_guanshi_fc is not None else Decimal('0')
|
base = default_guanshi_fc if default_guanshi_fc is not None else Decimal('0')
|
||||||
return base if base > 0 else None
|
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
|
return None
|
||||||
|
|
||||||
|
|
||||||
@@ -240,6 +248,14 @@ def calc_zuzhang_member_fenhong(huiyuan_id, zuzhang_id, cishu, club_id, default_
|
|||||||
if cishu == 1:
|
if cishu == 1:
|
||||||
base = default_zuzhang_fc if default_zuzhang_fc is not None else Decimal('0')
|
base = default_zuzhang_fc if default_zuzhang_fc is not None else Decimal('0')
|
||||||
return base if base > 0 else None
|
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
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user