stanley-king %!s(int64=2) %!d(string=hai) anos
pai
achega
6640f577b5
Modificáronse 2 ficheiros con 20 adicións e 0 borrados
  1. 9 0
      helper/refill/util.php
  2. 11 0
      test/TestRefillMonitor.php

+ 9 - 0
helper/refill/util.php

@@ -633,6 +633,15 @@ class util
 
         $ins->hdel($name, $key);
     }
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+    public static function debts_stoped($mchid)
+    {
+        if($mchid > 0) {
+            $ret = rcache('merchant-debt-judge', 'refill-',"{$mchid}");
+
+        }
+    }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     public static function push_queue_order($mchid,$mch_order,$order_state)

+ 11 - 0
test/TestRefillMonitor.php

@@ -56,4 +56,15 @@ class TestRefillMonitor extends TestCase
         $val = json_encode($mtimes);
         wkcachex('stat-earliest-ordertime', $val, 'refill-');
     }
+
+    public function testDebts()
+    {
+        wcache('merchant-debt-judge', [1 => 1], 'refill-');
+        $ret = rcache('merchant-debt-judge','refill-','1');
+        $ret = rcache('merchant-debt-judge','refill-','2');
+
+        wcache('merchant-debt-judge', [2 => 0], 'refill-');
+        $ret = rcache('merchant-debt-judge','refill-','2');
+
+    }
 }