diff --git a/Application/Admin/View/Game/add.html b/Application/Admin/View/Game/add.html index 25d8b48a5..b17f76de1 100644 --- a/Application/Admin/View/Game/add.html +++ b/Application/Admin/View/Game/add.html @@ -713,7 +713,7 @@ diff --git a/Application/Admin/View/GameSource/add.html b/Application/Admin/View/GameSource/add.html index 1c9c6d83f..63e452bae 100644 --- a/Application/Admin/View/GameSource/add.html +++ b/Application/Admin/View/GameSource/add.html @@ -96,7 +96,7 @@ - + diff --git a/Application/Base/Service/GameRebateService.class.php b/Application/Base/Service/GameRebateService.class.php index 4b2d39f0d..0e2b8e142 100644 --- a/Application/Base/Service/GameRebateService.class.php +++ b/Application/Base/Service/GameRebateService.class.php @@ -4,6 +4,7 @@ namespace Base\Service; use Base\Tool\GameResource\SbcqClient; use Base\Tool\GameResource\XlqyClient; use Base\Tool\GameResource\XyyXmjsClient; +use Base\Tool\GameResource\ZxjClient; use Exception; use GuzzleHttp\Client; use Think\Model; @@ -49,7 +50,7 @@ class GameRebateService 'J' => 'propsApplication', ]; - public $rebateBaseGameIds = [70, 73, 75]; + public $rebateBaseGameIds = [70, 73, 75, 79]; public function isGiftItemSend($order, $item) { @@ -123,6 +124,9 @@ class GameRebateService case 75: $client = new XlqyClient(); break; + case 79: + $client = new ZxjClient(); + break; case 9: $client = new XlqyClient(); break; diff --git a/Application/Base/Tool/GameResource.class.php b/Application/Base/Tool/GameResource.class.php index 2360de682..7c372120f 100644 --- a/Application/Base/Tool/GameResource.class.php +++ b/Application/Base/Tool/GameResource.class.php @@ -42,6 +42,8 @@ class GameResource 257 => XyyClient::class, // 逍遥游(苹果版) 293 => XyyClient::class, // 逍遥游之仙魔之战(安卓版) 294 => XyyClient::class, // 逍遥游之仙魔之战(苹果版) + 299 => ZxjClient::class, // 诛神记(安卓版) + 300 => ZxjClient::class, // 诛神记(苹果版) ]; public function __construct($game) diff --git a/Application/Base/Tool/GameResource/XlqyClient.class.php b/Application/Base/Tool/GameResource/XlqyClient.class.php index d4513de8c..51175e0cf 100644 --- a/Application/Base/Tool/GameResource/XlqyClient.class.php +++ b/Application/Base/Tool/GameResource/XlqyClient.class.php @@ -20,10 +20,12 @@ class XlqyClient // const APP_ID = '77A38AE4C5CAD6756'; // IOS // const SIGN_KEY = 'rKkoznJcEhWaVPSuBnH1QnC9goDd4TcB'; // IOS + protected $logTag = 'rebate:XLQY '; + protected $client; protected $currentName; - private $apis = [ + protected $apis = [ 'send-email' => ['uri' => '/apip/payWM450S00/emRebate', 'method' => 'post'], 'send-testing' => ['uri' => '/apip/payWM450S00/testingOrder', 'method' => 'post'], 'send-props' => ['uri' => '/apip/payWM450S00/buyProp', 'method' => 'post'], @@ -44,7 +46,7 @@ class XlqyClient if (is_null($api)) { throw new \Exception('接口不存在'); } - $params[self::SIGN_NAME] = $this->sign($name, $params); + $params[static::SIGN_NAME] = $this->sign($name, $params); // 发放道具接口特殊处理 if ($name == 'send-props') { @@ -54,7 +56,7 @@ class XlqyClient return $this->request($api, $params); } catch (\Exception $e) { $env = C('APP_ENV', null, 'prod'); - Log::error('rebate:XLQY ' . $e->getMessage()); + Log::error($this->logTag . $e->getMessage()); return ['code' => 3, 'msg' => '接口请求错误。' . ($env == 'prod' ? '' : $e->getMessage()) , 'data' => []]; } } @@ -75,7 +77,7 @@ class XlqyClient 'form_params' => $params, ]); $result = (string)$response->getBody(); - Log::info('rebate:XLQY ' . $uri . ' -- '. json_encode($params) . ' -- '. $result); + Log::info($this->logTag . $uri . ' -- '. json_encode($params) . ' -- '. $result); if ($this->currentName == 'send-testing') { return $this->prepareResult($result); } @@ -89,7 +91,7 @@ class XlqyClient 'query' => $params, ]); $result = (string)$response->getBody(); - Log::info('rebate:XLQY ' . $uri . ' -- '. json_encode($params) . ' -- '. $result); + Log::info($this->logTag . $uri . ' -- '. json_encode($params) . ' -- '. $result); if ($this->currentName == 'send-testing') { return $this->prepareResult($result); } @@ -122,7 +124,7 @@ class XlqyClient $params['serviceId'] . $params['roleId'] . $params['time'] . - self::SIGN_KEY + static::SIGN_KEY ); } elseif ($name == 'send-testing') { return md5( @@ -133,7 +135,7 @@ class XlqyClient $params['serviceId'] . $params['roleId'] . $params['time'] . - self::SIGN_KEY + static::SIGN_KEY ); } elseif ($name == 'send-props') { $signStr = ''; @@ -144,7 +146,7 @@ class XlqyClient } $signStr .= $key . '='. trim(urlencode($value)) . '&'; } - $signStr .= 'key=' . self::SIGN_KEY; + $signStr .= 'key=' . static::SIGN_KEY; $signStr = md5($signStr); return $signStr; } else { @@ -155,7 +157,7 @@ class XlqyClient public function sendEmail($giftItem, $order) { $data = [ - 'appId' => self::APP_ID, + 'appId' => static::APP_ID, 'userId' => $order['user_id'], 'serviceId' => $order['server_id'], 'roleId' => $order['role_id'], @@ -186,7 +188,7 @@ class XlqyClient 'time' => date('Y-m-d H:i:s'), 'role_id' => $order['role_id'], 'orderNum' => $this->generateOrderNumber($order), - 'appId' => self::APP_ID, + 'appId' => static::APP_ID, 'totalprice' => $order['amount'], 'prop' => $props ]; @@ -221,7 +223,7 @@ class XlqyClient public function apply($order, $role) { $data = [ - 'appId' => self::APP_ID, + 'appId' => static::APP_ID, 'userId' => $role['user_id'], 'serviceId' => $role['server_id'], 'roleId' => $role['role_id'], diff --git a/Application/Base/Tool/GameResource/ZxjClient.class.php b/Application/Base/Tool/GameResource/ZxjClient.class.php new file mode 100644 index 000000000..f7802098c --- /dev/null +++ b/Application/Base/Tool/GameResource/ZxjClient.class.php @@ -0,0 +1,26 @@ + ['uri' => '/apip/payWM451S00/emRebate', 'method' => 'post'], + 'send-testing' => ['uri' => '/apip/payWM451S00/testingOrder', 'method' => 'post'], + 'send-props' => ['uri' => '/apip/payWM451S00/buyProp', 'method' => 'post'], + ]; +} \ No newline at end of file