fix: 管事/组长分红入账接入资金冻结网关(会员/商家单/押金)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-29 00:50:13 +08:00
parent 0ebe5b4872
commit 8e7481e25d
6 changed files with 173 additions and 34 deletions

View File

@@ -182,10 +182,20 @@ def settle_shangjia_order_guanshi_fenhong(order, dashou_id):
try:
with transaction.atomic():
guanshi = UserGuanshi.objects.select_for_update().get(user__UserUID=guanshi_id)
UserGuanshi.objects.filter(id=guanshi.id).update(
yue=F('yue') + guanshi_fencheng,
chongzhifenrun=F('chongzhifenrun') + guanshi_fencheng,
from jituan.services.fund_freeze import credit_guanshi_fenhong
order_id = str(getattr(order, 'OrderID', '') or '')
result = credit_guanshi_fenhong(
user_id=str(guanshi_id),
amount=guanshi_fencheng,
biz_id=f'{order_id}:guanshi:merchant',
profile=guanshi,
order_id=order_id,
freeze_reason=f'商家订单分红 {order_id}',
)
if not result.get('idempotent'):
UserGuanshi.objects.filter(id=guanshi.id).update(
chongzhifenrun=F('chongzhifenrun') + guanshi_fencheng,
)
user_main = dashou.user
Gsfenhong.objects.create(