|
@@ -382,145 +382,6 @@ class util
|
|
|
return $ins->lLen('REFILL_MONITOR_QUEUE');
|
|
|
}
|
|
|
|
|
|
- //统计提交订单数据
|
|
|
- public static function incr_commit_pre($chname, $card_type, $spec, $quality)
|
|
|
- {
|
|
|
- $ins = Cache::getInstance('cacheredis');
|
|
|
-
|
|
|
- $name = 'commit_speed_monitor';
|
|
|
- $sec = time();
|
|
|
- $key_sec = "{$chname}-{$quality}-{$card_type}-{$spec}-{$sec}";
|
|
|
-
|
|
|
- $ins->hIncrBy($name, $key_sec, 1);
|
|
|
- }
|
|
|
-
|
|
|
- public static function hget_commit_pre_sec($chname, $card_type, $spec, $quality, $time_stamp)
|
|
|
- {
|
|
|
- $ins = Cache::getInstance('cacheredis');
|
|
|
-
|
|
|
- $name = 'commit_speed_monitor';
|
|
|
- $key_sec = "{$chname}-{$quality}-{$card_type}-{$spec}-{$time_stamp}";
|
|
|
- $value = $ins->hget($name, '', $key_sec);
|
|
|
-
|
|
|
- return intval($value);
|
|
|
- }
|
|
|
-
|
|
|
- //统计用户提交数据
|
|
|
- public static function incr_user_commit($mchid,$card_type, $spec,$quality)
|
|
|
- {
|
|
|
- $ins = Cache::getInstance('cacheredis');
|
|
|
-
|
|
|
- $name = 'user_monitor_commit';
|
|
|
- $sec = time();
|
|
|
- $key_sec = "{$mchid}-{$quality}-{$card_type}-{$spec}-{$sec}";
|
|
|
-
|
|
|
- $ins->hIncrBy($name, $key_sec, 1);
|
|
|
- }
|
|
|
-
|
|
|
- public static function incr_user_success($mchid,$card_type, $spec,$quality)
|
|
|
- {
|
|
|
- $ins = Cache::getInstance('cacheredis');
|
|
|
-
|
|
|
- $name = 'user_monitor_success';
|
|
|
- $sec = time();
|
|
|
- $key_sec = "{$mchid}-{$quality}-{$card_type}-{$spec}-{$sec}";
|
|
|
-
|
|
|
- $ins->hIncrBy($name, $key_sec, 1);
|
|
|
- }
|
|
|
-
|
|
|
- public static function incr_user_fail($mchid,$card_type, $spec,$quality)
|
|
|
- {
|
|
|
- $ins = Cache::getInstance('cacheredis');
|
|
|
-
|
|
|
- $name = 'user_monitor_fail';
|
|
|
- $sec = time();
|
|
|
- $key_sec = "{$mchid}-{$quality}-{$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');
|
|
|
-
|
|
|
- $name = 'channel_monitor_commit';
|
|
|
- $sec = time();
|
|
|
-
|
|
|
- if ($fsuccess) {
|
|
|
- $key_sec = "succ-{$chname}-{$quality}-{$card_type}-{$spec}-{$sec}";
|
|
|
- } else {
|
|
|
- $key_sec = "fail-{$chname}-{$quality}-{$card_type}-{$spec}-{$sec}";
|
|
|
- }
|
|
|
-
|
|
|
- $ins->hIncrBy($name, $key_sec, 1);
|
|
|
- }
|
|
|
-
|
|
|
- public static function hget_commit_sec($chname, $card_type, $spec, $quality, $time_stamp, $fsuccess = true)
|
|
|
- {
|
|
|
- $ins = Cache::getInstance('cacheredis');
|
|
|
-
|
|
|
- $name = 'channel_monitor_commit';
|
|
|
- if ($fsuccess) {
|
|
|
- $key_sec = "succ-{$chname}-{$quality}-{$card_type}-{$spec}-{$time_stamp}";
|
|
|
- } else {
|
|
|
- $key_sec = "fail-{$chname}-{$quality}-{$card_type}-{$spec}-{$time_stamp}";
|
|
|
- }
|
|
|
- $value = $ins->hget($name, '', $key_sec);
|
|
|
-
|
|
|
- return intval($value);
|
|
|
- }
|
|
|
-
|
|
|
- //统计回调通知数据
|
|
|
- public static function incr_notify($chname, $card_type, $spec, $quality, $fsuccess = true)
|
|
|
- {
|
|
|
- $ins = Cache::getInstance('cacheredis');
|
|
|
-
|
|
|
- $name = 'channel_monitor_notify';
|
|
|
- $sec = time();
|
|
|
-
|
|
|
- if ($fsuccess) {
|
|
|
- $key_sec = "succ-{$chname}-{$quality}-{$card_type}-{$spec}-{$sec}";
|
|
|
- } else {
|
|
|
- $key_sec = "fail-{$chname}-{$quality}-{$card_type}-{$spec}-{$sec}";
|
|
|
- }
|
|
|
-
|
|
|
- $ins->hIncrBy($name, $key_sec, 1);
|
|
|
- }
|
|
|
-
|
|
|
- public static function hget_notify_sec($chname, $card_type, $spec, $quality, $time_stamp, $fsuccess = true)
|
|
|
- {
|
|
|
- $ins = Cache::getInstance('cacheredis');
|
|
|
-
|
|
|
- $name = 'channel_monitor_notify';
|
|
|
- if ($fsuccess) {
|
|
|
- $key_sec = "succ-{$chname}-{$quality}-{$card_type}-{$spec}-{$time_stamp}";
|
|
|
- } else {
|
|
|
- $key_sec = "fail-{$chname}-{$quality}-{$card_type}-{$spec}-{$time_stamp}";
|
|
|
- }
|
|
|
- $value = $ins->hget($name, '', $key_sec);
|
|
|
-
|
|
|
- return intval($value);
|
|
|
- }
|
|
|
-
|
|
|
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
- public static function incr_amount_lock($mchid, $card_type, $spec)
|
|
|
- {
|
|
|
- if ($card_type == mtopcard\SinopecCard || $card_type == mtopcard\PetroChinaCard) {
|
|
|
- refill\rlock::incr_sys_storage($card_type,$spec,1);
|
|
|
- refill\rlock::incr_mch_total_storage($mchid,$card_type,$spec);
|
|
|
- refill\rlock::incr_mch_storage($mchid,$card_type,$spec,1);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static function decr_amount_lock($mchid, $card_type, $spec)
|
|
|
- {
|
|
|
- if ($card_type == mtopcard\SinopecCard || $card_type == mtopcard\PetroChinaCard) {
|
|
|
- refill\rlock::decr_sys_storage($card_type,$spec,1);
|
|
|
- refill\rlock::decr_mch_total_storage($mchid,$card_type,$spec);
|
|
|
- refill\rlock::decr_mch_storage($mchid,$card_type,$spec,1);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
public static function monitor_submit($mchid, $spec, $card_type, $mch_amount, $time)
|
|
|
{
|
|
@@ -904,7 +765,6 @@ class util
|
|
|
return [false, $errmsg];
|
|
|
}
|
|
|
|
|
|
- refill\util::incr_user_success($mchid,$order->card_type(), $order->spec(),$order->cur_quality());
|
|
|
$mod_refill->edit($success_order_id, ['mch_notify_state' => 1, 'mch_notify_times' => ['exp', 'mch_notify_times+1']]);
|
|
|
$mod_refill->edit($order_id, ['is_retrying' => 0]);
|
|
|
if($manual_recharge_amount > 0) {
|