diff --git a/Application/Base/Tool/GameResource.class.php b/Application/Base/Tool/GameResource.class.php index 5b2cd5a67..2360de682 100644 --- a/Application/Base/Tool/GameResource.class.php +++ b/Application/Base/Tool/GameResource.class.php @@ -47,19 +47,19 @@ class GameResource public function __construct($game) { $this->game = $game; - $this->client = $this->createClient(); + $this->client = $this->createClient($game); } - private function createClient() + private function createClient($game) { $clientClass = ''; - $gameId = intval($this->game['id']); + $gameId = intval($game['id']); if (isset($this->clientMap[$gameId])) { $clientClass = $this->clientMap[$gameId]; } else { throw new \Exception('游戏资源客户端未配置'); } - return new $clientClass(); + return new $clientClass($game); } public function getResourceTypes() diff --git a/Application/Base/Tool/GameResource/LeyouClient.class.php b/Application/Base/Tool/GameResource/LeyouClient.class.php index d1ae70c11..71bf983b3 100644 --- a/Application/Base/Tool/GameResource/LeyouClient.class.php +++ b/Application/Base/Tool/GameResource/LeyouClient.class.php @@ -23,7 +23,7 @@ class LeyouClient 'provide' => ['uri' => '/api/game/sendGold/zhuimeng/jxlm/57972', 'method' => 'post'], ]; - public function __construct() + public function __construct($game = null) { $this->client = new Client([ 'base_uri' => 'http://chat.leniu.com', diff --git a/Application/Base/Tool/GameResource/LsxxClient.class.php b/Application/Base/Tool/GameResource/LsxxClient.class.php index 057d4b875..1d2a4fcb0 100644 --- a/Application/Base/Tool/GameResource/LsxxClient.class.php +++ b/Application/Base/Tool/GameResource/LsxxClient.class.php @@ -21,7 +21,7 @@ class LsxxClient 'provide' => ['uri' => '/wanmeng/prop.php?action=prop', 'method' => 'post'], ]; - public function __construct() + public function __construct($game = null) { $this->client = new Client([ 'base_uri' => 'http://47.114.91.166:1096', diff --git a/Application/Base/Tool/GameResource/SbcqClient.class.php b/Application/Base/Tool/GameResource/SbcqClient.class.php index 2b8a59fe3..9e27ad69b 100644 --- a/Application/Base/Tool/GameResource/SbcqClient.class.php +++ b/Application/Base/Tool/GameResource/SbcqClient.class.php @@ -23,7 +23,7 @@ class SbcqClient 'send-email' => ['uri' => 'sendemail', 'method' => 'post'], ]; - public function __construct() + public function __construct($game = null) { $this->client = new Client([ 'base_uri' => 'http://api.tlcq.90wqiji.com/wan/game/', diff --git a/Application/Base/Tool/GameResource/XlqyClient.class.php b/Application/Base/Tool/GameResource/XlqyClient.class.php index 69580ac94..d4513de8c 100644 --- a/Application/Base/Tool/GameResource/XlqyClient.class.php +++ b/Application/Base/Tool/GameResource/XlqyClient.class.php @@ -29,7 +29,7 @@ class XlqyClient 'send-props' => ['uri' => '/apip/payWM450S00/buyProp', 'method' => 'post'], ]; - public function __construct() + public function __construct($game = null) { $this->client = new Client([ 'base_uri' => 'http://xx2api.hnputihd.com', diff --git a/Application/Base/Tool/GameResource/XyyClient.class.php b/Application/Base/Tool/GameResource/XyyClient.class.php index c7d71976d..8bc8faa95 100644 --- a/Application/Base/Tool/GameResource/XyyClient.class.php +++ b/Application/Base/Tool/GameResource/XyyClient.class.php @@ -16,13 +16,19 @@ class XyyClient const SIGN_KEY = '51a447dc409b785af03e41a2d5014879'; protected $client; + private $platformId = 600; private $apis = [ 'provide' => ['uri' => '/Api/Statis/sendgold', 'method' => 'post'], ]; - public function __construct() + public function __construct($game = null) { + if ($game && ($game['id'] == 293 || $game['id'] == 294)) { + $this->platformId = 602; + } else { + $this->platformId = 600; + } $this->client = new Client([ 'base_uri' => 'http://x3wm.dgcgame.com:82', 'timeout' => 10.0, @@ -112,7 +118,7 @@ class XyyClient public function apply($order, $role) { $data = [ - 'pfrom_id' => 600, + 'pfrom_id' => $this->platformId, 'server_id' => $role['server_id'], 'actors' => $role['role_id'], 'sendnum_yb' => intval($order['ref_amount']) * 10, diff --git a/Application/Base/Tool/GameResource/XyyXmjsClient.class.php b/Application/Base/Tool/GameResource/XyyXmjsClient.class.php index b7b7163c6..f2a8b5833 100644 --- a/Application/Base/Tool/GameResource/XyyXmjsClient.class.php +++ b/Application/Base/Tool/GameResource/XyyXmjsClient.class.php @@ -24,7 +24,7 @@ class XyyXmjsClient 'self-apply-foster' => ['uri' => '', 'method' => 'get'], ]; - public function __construct() + public function __construct($game = null) { $this->client = new Client([ 'base_uri' => 'http://rebate.99you.cn/xyy_apply.php/23400/', diff --git a/Application/Base/Tool/GameResource/YzchzbClient.class.php b/Application/Base/Tool/GameResource/YzchzbClient.class.php index a5832d35a..7e63177ad 100644 --- a/Application/Base/Tool/GameResource/YzchzbClient.class.php +++ b/Application/Base/Tool/GameResource/YzchzbClient.class.php @@ -31,7 +31,7 @@ class YzchzbClient 'ios' => 11596, ]; - public function __construct() + public function __construct($game = null) { $this->client = new Client([ 'base_uri' => C('GAME_CAT_URL'),