stanley-king 2 år sedan
förälder
incheckning
7554055676
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3 2
      plot/refill/MProfitRatioCalc.py

+ 3 - 2
plot/refill/MProfitRatioCalc.py

@@ -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)