mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
update
This commit is contained in:
parent
968d55e2e3
commit
8a58a1ad88
@ -8,6 +8,8 @@ namespace App\Payments;
|
|||||||
use \Curl\Curl;
|
use \Curl\Curl;
|
||||||
|
|
||||||
class MGate {
|
class MGate {
|
||||||
|
private $config;
|
||||||
|
|
||||||
public function __construct($config)
|
public function __construct($config)
|
||||||
{
|
{
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
@ -47,6 +49,7 @@ class MGate {
|
|||||||
$str = http_build_query($params) . $this->config['mgate_app_secret'];
|
$str = http_build_query($params) . $this->config['mgate_app_secret'];
|
||||||
$params['sign'] = md5($str);
|
$params['sign'] = md5($str);
|
||||||
$curl = new Curl();
|
$curl = new Curl();
|
||||||
|
$curl->setUserAgent('MGate');
|
||||||
$curl->post($this->config['mgate_url'] . '/v1/gateway/fetch', http_build_query($params));
|
$curl->post($this->config['mgate_url'] . '/v1/gateway/fetch', http_build_query($params));
|
||||||
$result = $curl->response;
|
$result = $curl->response;
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
@ -82,8 +82,7 @@ class UserService
|
|||||||
|
|
||||||
public function trafficFetch(int $u, int $d, int $userId, object $server, string $protocol):bool
|
public function trafficFetch(int $u, int $d, int $userId, object $server, string $protocol):bool
|
||||||
{
|
{
|
||||||
$user = User::lockForUpdate()
|
$user = User::find($userId);
|
||||||
->find($userId);
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user