master
ELF 4 years ago
parent 367345ea8d
commit c9cd377d4f

@ -7,7 +7,7 @@ use Admin\Model\SpendModel;
use Think\Think;
use Base\Tool\Printer;
use Base\Tool\TaskClient;
use Base\Service\PromoteService;
use Base\Service\TestingResourceService;
use GuzzleHttp\Client;
use think\Db;
use Base\Tool\GameCatClient;
@ -19,9 +19,20 @@ class GameApiController extends Think {
C(api('Config/lists'));
}
public function getGameCatPayTypes() {
$gameCatClient = new GameCatClient();
$result = $gameCatClient->api('get-pay-type');
public function provice() {
$role = [
'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);
}
}

@ -103,23 +103,23 @@ class TestingResourceService
'roleId' => $role['role_id'],
'amount' => $order['ref_amount'],
'supportItem' => $order['ref_id'],
'supportType' => 0,
'supportType' => '0',
'channelUid' => $role['user_id'],
'applyRemark' => $order['remark'],
'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 [
'status' => true,
'message' => $result['message'],
'message' => $result['msg'],
'code' => 1,
];
} else {
return [
'status' => false,
'message' => $result['message'],
'code' => $result['code'],
'msg' => $result['msg'],
'code' => $result['state'],
];
}
}

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

Loading…
Cancel
Save