thirdpayment
elf 11 months ago
parent 37d1c52aab
commit 2033a091df

@ -115,7 +115,11 @@ class AccountController extends AbstractController
{ {
$userInfo = $this->checkUser($request); $userInfo = $this->checkUser($request);
$userId = $this->resetUserId($userInfo['userId']); $userId = $this->resetUserId($userInfo['userId']);
$requestLog = $this->createRequestLog(['userId' => $userId]); $bankCard = BankCard::where('id', $request->input('id', 0))->first();
if (!$bankCard || $bankCard->user_id != $userId) {
throw new BusinessException('银行卡不存在');
}
$requestLog = $this->createRequestLog(['userId' => $userId, 'agreementNo' => $bankCard->agreement_no]);
$result = $this->userService->unbindCard($requestLog->getData(), $requestLog->app); $result = $this->userService->unbindCard($requestLog->getData(), $requestLog->app);
return $this->success(['result' => $result]); return $this->success(['result' => $result]);
} }
@ -175,7 +179,7 @@ class AccountController extends AbstractController
$account = Account::where('id', $userInfo['userId'])->first(); $account = Account::where('id', $userInfo['userId'])->first();
$userId = $this->resetUserId($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']); $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']); $bankCard = BankCard::where('user_id', $userId)->first(['id', 'bank_name', 'card_user_name']);
return $this->success(['username' => $account->username, 'userInfo' => $user, 'bankCard' => $bankCard]); return $this->success(['username' => $account->username, 'userInfo' => $user, 'bankCard' => $bankCard]);
} }

@ -66,6 +66,7 @@
is_platform_account: '' is_platform_account: ''
}, },
bankCard: { bankCard: {
id: 0,
bank_name: '', bank_name: '',
card_user_name: '' card_user_name: ''
} }
@ -165,7 +166,7 @@
console.log('submit!'); console.log('submit!');
}, },
unbindCard() { unbindCard() {
axios.post('/account/unbind-card', {token: window.sessionStorage.getItem('token')}) axios.post('/account/unbind-card', {token: window.sessionStorage.getItem('token'), id: this.bankCard.id})
.then( (response) => { .then( (response) => {
console.log(response); console.log(response);
let result = response.data let result = response.data

Loading…
Cancel
Save