|
@@ -33,13 +33,14 @@ class MProfitRatioCalc(MerchantCalc):
|
|
|
gross = dict()
|
|
|
detail = dict()
|
|
|
|
|
|
+ _fix = False
|
|
|
for mchid, period, formula in mixed_ratios:
|
|
|
logger.debug(f'mchid={mchid} period={period}')
|
|
|
-
|
|
|
end_time = int(time.time())
|
|
|
if period == 86401:
|
|
|
cur_day = day_stamp(end_time)
|
|
|
period = end_time - cur_day
|
|
|
+ _fix = True
|
|
|
logger.debug(f'mchid={mchid} period={period}')
|
|
|
|
|
|
days, start_time, end_time = self.calc_time(reader, end_time - period, end_time)
|
|
@@ -57,7 +58,7 @@ 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 succ_count == 0:
|
|
|
+ if _fix == True and succ_count == 0:
|
|
|
profit += 5
|
|
|
spec_amount += 5
|
|
|
profit_ratio = profit / (spec_amount + 0.000001)
|