|
@@ -6,6 +6,7 @@ require_once(BASE_HELPER_RAPI_PATH . '/by_online/config.php');
|
|
|
|
|
|
use refill;
|
|
|
use Log;
|
|
|
+use Cache;
|
|
|
|
|
|
class RefillPhone extends refill\IRefillPhone
|
|
|
{
|
|
@@ -37,6 +38,10 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
return [false, '省份获取错误', false];
|
|
|
}
|
|
|
|
|
|
+ if($this->exist($card_no)) {
|
|
|
+ return [false, '今日已经提交过', false];
|
|
|
+ }
|
|
|
+
|
|
|
$params = $this->req_params($card_no, $amount, $card_type, $params['order_sn'], $regin_no);
|
|
|
$sign = config::sign($params);
|
|
|
$params['sign'] = $sign;
|
|
@@ -127,4 +132,21 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private function exist($card_no)
|
|
|
+ {
|
|
|
+ $ins = Cache::getInstance('cacheredis');
|
|
|
+ $today = strtotime(date('Ymd',time()));
|
|
|
+
|
|
|
+ $name = "unique_tongfu_{$today}";
|
|
|
+ $key = "$card_no";
|
|
|
+
|
|
|
+ $value = $ins->hget($name,'',$key);
|
|
|
+ if($value === false) {
|
|
|
+ $ins->hset($name, '', [$key=> 1]);
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|