stanley-king hace 3 años
padre
commit
88f61ff5c8
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 3 1
      rdispatcher/proxy.php
  2. 0 1
      test/TestRedis.php

+ 3 - 1
rdispatcher/proxy.php

@@ -37,8 +37,10 @@ class proxy
         Log::record("proxy::add mch_order={$mch_order} card_no = {$card_no}",Log::DEBUG);
 
         $need_check = false;
+        $first_comit = false;
         if($card_type == 0)
         {
+            $first_comit = true;
             $card_type = mtopcard\card_type($card_no,$regin_no);
             $params['card_type'] = $card_type;
             $params['regin_no'] = $regin_no;
@@ -50,7 +52,7 @@ class proxy
         }
 
         [$org_quality,$quality] = refill\RefillFactory::instance()->find_quality($mchid,$amount,$card_type,$org_quality,$commit_times,time() - $order_time);
-        if($card_type == 0) {
+        if($first_comit) {
             refill\util::incr_user_commit($mchid,$card_type,$amount,$org_quality);
         }
 

+ 0 - 1
test/TestRedis.php

@@ -1,7 +1,6 @@
 <?php declare(strict_types=0);
 
 use PHPUnit\Framework\TestCase;
-use statistics\stat_refill;
 
 define('APP_ID', 'test');
 define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));