master
ELF 5 years ago
parent 367345ea8d
commit c9cd377d4f

@ -7,7 +7,7 @@ use Admin\Model\SpendModel;
use Think\Think; use Think\Think;
use Base\Tool\Printer; use Base\Tool\Printer;
use Base\Tool\TaskClient; use Base\Tool\TaskClient;
use Base\Service\PromoteService; use Base\Service\TestingResourceService;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use think\Db; use think\Db;
use Base\Tool\GameCatClient; use Base\Tool\GameCatClient;
@ -19,9 +19,20 @@ class GameApiController extends Think {
C(api('Config/lists')); C(api('Config/lists'));
} }
public function getGameCatPayTypes() { public function provice() {
$gameCatClient = new GameCatClient(); $role = [
$result = $gameCatClient->api('get-pay-type'); 'role_id' => '1027690927',
'user_id' => '90319',
'sdk_version' => 1,
];
$order = [
'ref_amount' => 10,
'ref_id' => '8',
'remark' => 'ELF测试资源发放',
'order_no' => date('YmdHis') . rand(1000, 9999) . '_1',
];
$service = new TestingResourceService();
$result = $service->provideFromGameCat($order, $role);
var_dump($result); var_dump($result);
} }
} }

@ -103,23 +103,23 @@ class TestingResourceService
'roleId' => $role['role_id'], 'roleId' => $role['role_id'],
'amount' => $order['ref_amount'], 'amount' => $order['ref_amount'],
'supportItem' => $order['ref_id'], 'supportItem' => $order['ref_id'],
'supportType' => 0, 'supportType' => '0',
'channelUid' => $role['user_id'], 'channelUid' => $role['user_id'],
'applyRemark' => $order['remark'], 'applyRemark' => $order['remark'],
'applyId' => $order['order_no'], 'applyId' => $order['order_no'],
'device_type' => $deviceType, 'device_type' => $role['sdk_version'] == 1 ? 'andriod' : 'ios',
]); ]);
if ($result['code'] == 1 && $result['data']) { if ($result['state'] == 1 && $result['data']) {
return [ return [
'status' => true, 'status' => true,
'message' => $result['message'], 'message' => $result['msg'],
'code' => 1, 'code' => 1,
]; ];
} else { } else {
return [ return [
'status' => false, 'status' => false,
'message' => $result['message'], 'msg' => $result['msg'],
'code' => $result['code'], 'code' => $result['state'],
]; ];
} }
} }

@ -53,7 +53,6 @@ class GameCatClient
$params['channelId'] = $this->channelIds[$deviceType] ?? $this->channelIds['andriod']; $params['channelId'] = $this->channelIds[$deviceType] ?? $this->channelIds['andriod'];
$params['timestamp'] = time(); $params['timestamp'] = time();
$params[self::SIGN_NAME] = $this->sign($params); $params[self::SIGN_NAME] = $this->sign($params);
try { try {
return $this->request($api, $params); return $this->request($api, $params);
} catch (\Exception $e) { } catch (\Exception $e) {
@ -78,6 +77,9 @@ class GameCatClient
'form_params' => $params, 'form_params' => $params,
]); ]);
$result = (string)$response->getBody(); $result = (string)$response->getBody();
var_dump($uri);
var_dump($params);
var_dump($result);
return json_decode($result, true); return json_decode($result, true);
} }

Loading…
Cancel
Save