|
|
@ -4,6 +4,7 @@ namespace Base\Tool\GameResource;
|
|
|
|
|
|
|
|
|
|
|
|
use GuzzleHttp\Client;
|
|
|
|
use GuzzleHttp\Client;
|
|
|
|
use GuzzleHttp\Exception\RequestException;
|
|
|
|
use GuzzleHttp\Exception\RequestException;
|
|
|
|
|
|
|
|
use Think\Log;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 双倍传奇-测试资源接口
|
|
|
|
* 双倍传奇-测试资源接口
|
|
|
@ -18,14 +19,14 @@ class SbcqClient
|
|
|
|
protected $client;
|
|
|
|
protected $client;
|
|
|
|
|
|
|
|
|
|
|
|
private $apis = [
|
|
|
|
private $apis = [
|
|
|
|
'send-gold' => ['uri' => '/sendgold', 'method' => 'get'],
|
|
|
|
'send-gold' => ['uri' => 'sendgold', 'method' => 'post'],
|
|
|
|
'send-email' => ['uri' => '/sendemail', 'method' => 'get'],
|
|
|
|
'send-email' => ['uri' => 'sendemail', 'method' => 'post'],
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->client = new Client([
|
|
|
|
$this->client = new Client([
|
|
|
|
'base_uri' => 'http://api.tlcq.90wqiji.com/wan/game',
|
|
|
|
'base_uri' => 'http://api.tlcq.90wqiji.com/wan/game/',
|
|
|
|
'timeout' => 10.0,
|
|
|
|
'timeout' => 10.0,
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -61,6 +62,7 @@ class SbcqClient
|
|
|
|
'form_params' => $params,
|
|
|
|
'form_params' => $params,
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
$result = (string)$response->getBody();
|
|
|
|
$result = (string)$response->getBody();
|
|
|
|
|
|
|
|
Log::record('rebate:SBCQ ' . $uri . ' -- '. json_encode($params) . ' -- '. $result);
|
|
|
|
return json_decode($result, true);
|
|
|
|
return json_decode($result, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -71,6 +73,7 @@ class SbcqClient
|
|
|
|
'query' => $params,
|
|
|
|
'query' => $params,
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
$result = (string)$response->getBody();
|
|
|
|
$result = (string)$response->getBody();
|
|
|
|
|
|
|
|
Log::record('rebate:SBCQ ' . $uri . ' -- '. json_encode($params) . ' -- '. $result);
|
|
|
|
return json_decode($result, true);
|
|
|
|
return json_decode($result, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -87,7 +90,7 @@ class SbcqClient
|
|
|
|
'num' => $giftItem['num'],
|
|
|
|
'num' => $giftItem['num'],
|
|
|
|
'name' => $giftItem['id'],
|
|
|
|
'name' => $giftItem['id'],
|
|
|
|
'role' => $order['role_name'],
|
|
|
|
'role' => $order['role_name'],
|
|
|
|
'content' => '',
|
|
|
|
'content' => '您的福利已到账,请查收',
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
$result = $this->api('send-email', $data);
|
|
|
|
$result = $this->api('send-email', $data);
|
|
|
|