|
|
|
@ -96,8 +96,8 @@ class AccountController extends AbstractController
|
|
|
|
|
public function openAccount(RequestInterface $request)
|
|
|
|
|
{
|
|
|
|
|
$userInfo = $this->checkUser($request);
|
|
|
|
|
$requestLog = $this->createRequestLog(['userId' => 'ACT_' . $userInfo['userId']]);
|
|
|
|
|
var_dump($requestLog->toArray());
|
|
|
|
|
$userId = $this->resetUserId($userInfo['userId']);
|
|
|
|
|
$requestLog = $this->createRequestLog(['userId' => $userId, 'returnUrl' => 'http://124.223.222.61:9701/account.html']);
|
|
|
|
|
$url = $this->userService->register($requestLog->getData(), $requestLog->app, $requestLog->request_token);
|
|
|
|
|
return $this->success(['url' => $url]);
|
|
|
|
|
}
|
|
|
|
@ -105,7 +105,8 @@ class AccountController extends AbstractController
|
|
|
|
|
public function bindCard(RequestInterface $request)
|
|
|
|
|
{
|
|
|
|
|
$userInfo = $this->checkUser($request);
|
|
|
|
|
$requestLog = $this->createRequestLog(['userId' => 'ACT_' . $userInfo['userId']]);
|
|
|
|
|
$userId = $this->resetUserId($userInfo['userId']);
|
|
|
|
|
$requestLog = $this->createRequestLog(['userId' => $userId]);
|
|
|
|
|
$url = $this->userService->bindCard($requestLog->getData(), $requestLog->app, $requestLog->request_token);
|
|
|
|
|
return $this->success(['url' => $url]);
|
|
|
|
|
}
|
|
|
|
@ -113,9 +114,10 @@ class AccountController extends AbstractController
|
|
|
|
|
public function transferPay(RequestInterface $request)
|
|
|
|
|
{
|
|
|
|
|
$userInfo = $this->checkUser($request);
|
|
|
|
|
$bankCard = BankCard::where('user_id', 'ACT_' . $userInfo['userId'])->first();
|
|
|
|
|
$userId = $this->resetUserId($userInfo['userId']);
|
|
|
|
|
$bankCard = BankCard::where('user_id', $userId)->first();
|
|
|
|
|
$requestLog = $this->createRequestLog([
|
|
|
|
|
'userId' => 'ACT_' . $userInfo['userId'],
|
|
|
|
|
'userId' => $userId,
|
|
|
|
|
'goodsName' => '充值',
|
|
|
|
|
'agreementNo' => $bankCard->agreement_no,
|
|
|
|
|
'notifyUrl' => 'http://www.baidu.com',
|
|
|
|
@ -143,11 +145,17 @@ class AccountController extends AbstractController
|
|
|
|
|
public function getUserInfo(RequestInterface $request)
|
|
|
|
|
{
|
|
|
|
|
$userInfo = $this->checkUser($request);
|
|
|
|
|
var_dump($userInfo);
|
|
|
|
|
$account = Account::where('id', $userInfo['userId'])->first();
|
|
|
|
|
$userId = 'ACT_' . $userInfo['userId'];
|
|
|
|
|
$userId = $this->resetUserId($userInfo['userId']);
|
|
|
|
|
$user = User::where('user_id', $userId)->first(['realname_flag', 'bind_card_flag', 'set_pwd_flag', 'mobile', 'real_name', 'certificate_no', 'user_type', 'apply_no', 'is_platform_account']);
|
|
|
|
|
$bankCard = BankCard::where('user_id', $userId)->first(['bank_name', 'card_user_name']);
|
|
|
|
|
return $this->success(['username' => $account->username, 'userInfo' => $user, 'bankCard' => $bankCard]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function resetUserId($accountId) {
|
|
|
|
|
if ($accountId == 2) {
|
|
|
|
|
return 'ELF1990';
|
|
|
|
|
}
|
|
|
|
|
return 'ACT_' . $accountId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|