parent
ab3df41fe5
commit
d554661485
|
@ -479,6 +479,12 @@ class Douyin
|
||||||
|
|
||||||
public function _curl($url, $params, $method = 'GET')
|
public function _curl($url, $params, $method = 'GET')
|
||||||
{
|
{
|
||||||
|
// 请求次数统计
|
||||||
|
$key = sprintf("Douyin:ReqiestCount:%s", date('Y-m-d'));
|
||||||
|
$requestCount = Redis::incrBy($key, 1);
|
||||||
|
if ($requestCount == 1) {
|
||||||
|
Redis::expire($key, 604800); // 7天
|
||||||
|
}
|
||||||
|
|
||||||
$http = $this->gate . $url;
|
$http = $this->gate . $url;
|
||||||
if ($method == 'GET') {
|
if ($method == 'GET') {
|
||||||
|
|
|
@ -119,6 +119,13 @@ class Meituan {
|
||||||
|
|
||||||
public function _curl($url, $params, $method = 'GET') {
|
public function _curl($url, $params, $method = 'GET') {
|
||||||
|
|
||||||
|
// 请求次数统计
|
||||||
|
$key = sprintf("Meituan:ReqiestCount:%s", date('Y-m-d'));
|
||||||
|
$requestCount = Redis::incrBy($key, 1);
|
||||||
|
if ($requestCount == 1) {
|
||||||
|
Redis::expire($key, 604800); // 7天
|
||||||
|
}
|
||||||
|
|
||||||
$http = $this->gate.$url;
|
$http = $this->gate.$url;
|
||||||
if($method == 'GET') {
|
if($method == 'GET') {
|
||||||
$http = $http.'?'. http_build_query($params);
|
$http = $http.'?'. http_build_query($params);
|
||||||
|
|
Loading…
Reference in New Issue