From 02dcebd28e31145f02bef9476a4d0cf90bbfdc5a Mon Sep 17 00:00:00 2001 From: aaron <> Date: Sun, 6 Apr 2025 18:30:18 +0800 Subject: [PATCH] fix bug --- app/tasks/daily_tasks.py | 14 +++++++++----- jobs.sqlite | Bin 24576 -> 24576 bytes 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/tasks/daily_tasks.py b/app/tasks/daily_tasks.py index 69e8b97..f378527 100644 --- a/app/tasks/daily_tasks.py +++ b/app/tasks/daily_tasks.py @@ -244,6 +244,8 @@ async def daily_partner_settlement(): total_order_count = 0 total_original_amount = 0 total_final_amount = 0 + # 初始化沉淀金额总计 + total_profit_sediment = 0 settlement_history = [] for stat in yesterday_stats: @@ -307,7 +309,7 @@ async def daily_partner_settlement(): } # 如果没有运营商、服务商,则需要沉淀到平台 - total_profit_sediment = 0 + community_profit_sediment = 0 # 计算每个运营商的分成金额 if len(partner_ids) > 0: @@ -325,7 +327,7 @@ async def daily_partner_settlement(): account_manager = AccountManager(db) account_manager.change_balance(partner_id, per_partner_profit, f"【运营商】 {stat.community_name} 订单收益") else: - total_profit_sediment += partner_profit + community_profit_sediment += partner_profit # 计算服务商分成 @@ -340,7 +342,7 @@ async def daily_partner_settlement(): account_manager = AccountManager(db) account_manager.change_balance(community.admin_id, admin_profit, f"【服务商】 {stat.community_name} 订单收益") else: - total_profit_sediment += admin_profit + community_profit_sediment += admin_profit # 计算配送员分成 print(f"配送员({delivery_profit_sharing/100}%) 分成金额: {delivery_profit}") @@ -354,10 +356,12 @@ async def daily_partner_settlement(): # 计算平台分成 # 计算分成 + 沉淀金额 - final_platform_profit = platform_profit + total_profit_sediment + final_platform_profit = platform_profit + community_profit_sediment - print(f"平台({platform_profit_sharing/100}%) 分成: {platform_profit} + 沉淀金额: {total_profit_sediment}") + print(f"平台({platform_profit_sharing/100}%) 分成: {platform_profit} + 沉淀金额: {community_profit_sediment}") total_platform_profit += final_platform_profit + # 累加到总沉淀金额 + total_profit_sediment += community_profit_sediment settle_details["platform_profit"] = { "user_id": settings.PLATFORM_USER_ID, diff --git a/jobs.sqlite b/jobs.sqlite index b100100f58b68c13e71ed6a03afeab9d8e2d4eac..39a28355072dab14cb2e80f9b46d11001f9cd654 100644 GIT binary patch delta 82 zcmZoTz}Rqrae_4C>4`GVjHfpyS{||4)?Jo)^LtTaMn?9{%Hq8&?4Q485`0)?Jo)^LtTaMn<;H%Hq8&>>r~#8d#?~ jO?Gsb*?d`AmIWyOQJzVG2Pn?W!OX$}4Co>2h+$;BMR