stanley-king 3 năm trước cách đây
mục cha
commit
2658012375
2 tập tin đã thay đổi với 7 bổ sung8 xóa
  1. 3 4
      helper/refill/RefillBase.php
  2. 4 4
      plot/MchDataCenter.py

+ 3 - 4
helper/refill/RefillBase.php

@@ -149,6 +149,7 @@ class RefillBase
                         return true;
                     }
                 }
+                util::incr_user_fail($mchid,$card_type, $spec,$quality);
             }
             else {
                 $logic_vr_order->changeOrderStateCancel($order_info, '', "{$chname}接口回调通知失败,不可重试.",true,true);
@@ -156,15 +157,13 @@ class RefillBase
 
                 util::incr_notify($chname, $card_type, $spec, $quality, false);
                 util::incr_amount_lock($mchid,$card_type,$spec);
+                util::incr_user_fail($mchid,$card_type, $spec,$quality);
             }
 
             $mod_refill->edit($order_id, ['notify_time' => time(), 'is_retrying' => 0,'notify_state' => 1]);
             util::pop_queue_order($mchid,$mch_order);
             QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
-
-            if(!$success) {
-                util::incr_user_fail($mchid,$card_type, $spec,$quality);
-            }
+            
             return true;
         }
         catch (Exception $ex) {

+ 4 - 4
plot/MchDataCenter.py

@@ -363,10 +363,10 @@ class MchDataCenter(object):
         ax.plot(xs, ySucc, ls='--', marker='o', label=self._label(path, succ_count, all_count,commit_count,fail_count))
         return True
 
-    def _label(self, path, count, all,commit_count,fail_count):
+    def _label(self, path, succ_count, all, commit_count, fail_count):
         ratio = 0.00
         if all > 0:
-            ratio = round(count * 100 / all, 2)
+            ratio = round(succ_count * 100 / all, 2)
 
         items = re.split(r'/', path)
         if len(items) == 6:
@@ -384,11 +384,11 @@ class MchDataCenter(object):
                 card_type = 'DX'
             elif _card_type == '7':
                 card_type = 'TH'
-            return f"{_chname}-{_quality}-{card_type}-{_amount}:{count}/{all} = {ratio}% {commit_count}:{fail_count}"
+            return f"{_chname}-{_quality}-{card_type}-{_amount}:{succ_count}/{all} = {ratio}% {commit_count}:{fail_count}"
         else:
             if path == '' or path is None:
                 path = 'average'
-            return f"{path}:{count}/{all} = {ratio}% {commit_count}:{fail_count}"
+            return f"{path}:{succ_count}/{all} = {ratio}% {commit_count}:{fail_count}"
         pass
 
     #统计机构当前时间之前序列时间成功率