Переглянути джерело

Merge remote-tracking branch 'remotes/origin/peng' into test

Ansjer 1 рік тому
батько
коміт
d3895dbe01
1 змінених файлів з 1 додано та 2 видалено
  1. 1 2
      Controller/Cron/CronTaskController.py

+ 1 - 2
Controller/Cron/CronTaskController.py

@@ -1212,11 +1212,10 @@ class CronCollectDataView(View):
                     if CONFIG_INFO == CONFIG_CN:  # 国内要换算汇率
                         storage_cost = round(storage_cost * 7, 2)
                         api_cost = round(api_cost * 7, 2)
+                    profit = round(monthly_income - storage_cost - api_cost, 2)  # 利润=月结算金额-月成本
                     if monthly_income == 0.0:
-                        profit = 0
                         profit_margin = 0
                     else:
-                        profit = round(monthly_income - storage_cost - api_cost, 2)  # 利润=月结算金额-月成本
                         profit_margin = round(profit / month_average_price, 2)  # 利润率=利润/每月收入分摊
                     OperatingCosts.objects.filter(time=start_time_stamp, order_id=item['order_id'],
                                                   uid=item['uid']).update(day_average_price=day_average_price,