Merge pull request '优化' (#564) from feature/ts_zxj into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/564
master
廖金灵 3 years ago
commit 7a5ab46b39

@ -713,7 +713,7 @@
<td class="r">
<select name="data_share">
<option value="0">不互通</option>
<option value="1">互通</option>
<option value="1" selected>互通</option>
</select>
</td>
</tr>

@ -96,7 +96,7 @@
<td class="r table_radio">
<span class="form_radio">
<label><input type="radio" class="inp_radio" checked value="1" name="is_new_sdk" ></label>
<label><input type="radio" class="inp_radio" checked value="0" name="is_new_sdk" ></label>
<label><input type="radio" class="inp_radio" value="0" name="is_new_sdk" ></label>
</td>
</tr>

@ -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;

@ -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)

@ -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'],

@ -0,0 +1,26 @@
<?php
namespace Base\Tool\GameResource;
/**
* 诛仙记-测试资源接口
*/
class ZxjClient extends XlqyClient
{
const SIGN_NAME = 'sign';
const SUCCESS = '0000';
const APP_ID = '0128F8F8A0A5F302B';
const SIGN_KEY = 'q4KgAjRoNZS2necdysP6kDLrSLpW2wnN';
// const APP_ID = '1E1724B3359481095'; // IOS
// const SIGN_KEY = 'gr51n39msBI71aDh45s9yXvtcaOTef5s'; // IOS
protected $logTag = 'rebate:ZXJ ';
protected $apis = [
'send-email' => ['uri' => '/apip/payWM451S00/emRebate', 'method' => 'post'],
'send-testing' => ['uri' => '/apip/payWM451S00/testingOrder', 'method' => 'post'],
'send-props' => ['uri' => '/apip/payWM451S00/buyProp', 'method' => 'post'],
];
}
Loading…
Cancel
Save