stanley-king 4 rokov pred
rodič
commit
1ab96a54c9

+ 10 - 0
helper/refill/policy/rstorage.php

@@ -82,6 +82,16 @@ class merchant
             $amount = intval($amount);
             return $amount > 0 ? $amount : 0;
         }
+        elseif(array_key_exists($card_type, $this->mSpecLocks))
+        {
+            $specs = $this->mSpecLocks[$card_type];
+            $amounts = 0;
+            foreach ($specs as $spec) {
+                $amounts += $this->spec_total($card_type,$spec);
+            }
+
+            return $amounts;
+        }
         else {
             return 0;
         }

+ 12 - 16
helper/refill/util.php

@@ -291,6 +291,18 @@ class util
         return intval($value);
     }
 
+    //统计用户提交数据
+    public static function incr_user_commit($card_type, $spec)
+    {
+        $ins = Cache::getInstance('cacheredis');
+
+        $name = 'channel_monitor_user';
+        $sec = time();
+        $key_sec = "succ-{$card_type}-{$spec}-{$sec}";
+
+        $ins->hIncrBy($name, $key_sec, 1);
+    }
+
     public static function incr_commit($chname, $card_type, $spec, $quality, $fsuccess = true)
     {
         $ins = Cache::getInstance('cacheredis');
@@ -372,21 +384,5 @@ class util
             refill\rlock::decr_mch_storage($mchid,$card_type,$spec,1);
         }
     }
-
-    //todo delete this function
-    public static function set_amount_lock($mchid, $spec)
-    {
-        $ins = Cache::getInstance('cacheredis');
-        $name = 'mechant_amount_lock';
-        return $ins->hIncrBy($name, "{$mchid}", intval($spec));
-    }
-
-    //todo delete this function
-    public static function get_amount_lock($mchid)
-    {
-        $ins = Cache::getInstance('cacheredis');
-        $name = 'mechant_amount_lock';
-        return $ins->hget($name, '', "{$mchid}");
-    }
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 }

+ 2 - 0
rdispatcher/proxy.php

@@ -42,6 +42,8 @@ class proxy
             $params['card_type'] = $card_type;
             $params['regin_no'] = $regin_no;
 
+            refill\util::incr_user_commit($card_type,$amount);
+
             global $config;
             if($config['phone_life_check'] == true && $card_type != mtopcard\PetroChinaCard && $card_type != mtopcard\SinopecCard) {
                 $need_check = true;