|
@@ -49,6 +49,10 @@ class MProfitRatioCalc(MerchantCalc):
|
|
|
for _mchid, _card_type, _spec, _data in gen:
|
|
|
submit_count, succ_count, fail_count, succ_ratio, profit = calc_mch_profit(_data, pos_map, start, end)
|
|
|
if _card_type is None and _spec is None:
|
|
|
+ if submit_count == 0:
|
|
|
+ profit += 10
|
|
|
+ spec_amount += 10
|
|
|
+
|
|
|
profit_ratio = profit / (spec_amount + 0.000001)
|
|
|
gross[_mchid] = [submit_count, succ_count, fail_count, succ_ratio, profit, round(profit_ratio, 5)]
|
|
|
spec_amount = 0.0
|
|
@@ -56,6 +60,9 @@ class MProfitRatioCalc(MerchantCalc):
|
|
|
key = f"{_mchid}-{_card_type}-{_spec}"
|
|
|
amount = succ_count * _spec
|
|
|
spec_amount += amount
|
|
|
+ if submit_count == 0:
|
|
|
+ profit += 10
|
|
|
+ amount += 10
|
|
|
profit_ratio = profit / (amount + 0.000001)
|
|
|
detail[key] = [submit_count, succ_count, fail_count, succ_ratio, profit, round(profit_ratio, 5)]
|
|
|
|