|
@@ -37,10 +37,10 @@ class MProfitRatioCalc(MerchantCalc):
|
|
|
logger.debug(f'mchid={mchid} period={period}')
|
|
|
|
|
|
end_time = int(time.time())
|
|
|
- # if period == 86400:
|
|
|
- # cur_day = day_stamp(end_time)
|
|
|
- # period = end_time - cur_day
|
|
|
- # logger.debug(f'mchid={mchid} period={period}')
|
|
|
+ if period == 86401:
|
|
|
+ cur_day = day_stamp(end_time)
|
|
|
+ period = end_time - cur_day
|
|
|
+ logger.debug(f'mchid={mchid} period={period}')
|
|
|
|
|
|
days, start_time, end_time = self.calc_time(reader, end_time - period, end_time)
|
|
|
if len(days) == 0:
|
|
@@ -58,8 +58,8 @@ class MProfitRatioCalc(MerchantCalc):
|
|
|
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:
|
|
|
- profit += 10
|
|
|
- spec_amount += 10
|
|
|
+ profit += 5
|
|
|
+ spec_amount += 5
|
|
|
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
|