From 8a58a1ad8819a99b9341000186f8ee4e1f2315c2 Mon Sep 17 00:00:00 2001 From: tokumeikoi Date: Tue, 24 Aug 2021 16:50:45 +0900 Subject: [PATCH] update --- app/Payments/MGate.php | 3 +++ app/Services/UserService.php | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Payments/MGate.php b/app/Payments/MGate.php index 4ca19c54..9cf7dddd 100644 --- a/app/Payments/MGate.php +++ b/app/Payments/MGate.php @@ -8,6 +8,8 @@ namespace App\Payments; use \Curl\Curl; class MGate { + private $config; + public function __construct($config) { $this->config = $config; @@ -47,6 +49,7 @@ class MGate { $str = http_build_query($params) . $this->config['mgate_app_secret']; $params['sign'] = md5($str); $curl = new Curl(); + $curl->setUserAgent('MGate'); $curl->post($this->config['mgate_url'] . '/v1/gateway/fetch', http_build_query($params)); $result = $curl->response; if (!$result) { diff --git a/app/Services/UserService.php b/app/Services/UserService.php index 6464d3dd..ce115c98 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -82,8 +82,7 @@ class UserService public function trafficFetch(int $u, int $d, int $userId, object $server, string $protocol):bool { - $user = User::lockForUpdate() - ->find($userId); + $user = User::find($userId); if (!$user) { return true; }