master
ljl 1 year ago
parent 11ff7ab3aa
commit b2da675492

@ -99,4 +99,12 @@ class PaymentController extends AbstractController
$data = $this->paymentService->refundApply($app, $data);
return $this->success($data);
}
public function queryBindCards(RequestInterface $request)
{
[$app, $data, $token] = $this->parseReqest($request, UnbindCardRequest::class);
$this->userService->rsyncBankCards($data['userId']);
$records = $this->userService->getUserBankCards($data['userId'], $app);
return $this->success(['result' => $records]);
}
}

@ -105,6 +105,31 @@ class UserService extends AbstractService
}
}
public function getUserBankCards($userId, App $app)
{
$bankCards = BankCard::where('app_id', $app->app_id)->where('user_id', $userId)->get();
$records = [];
foreach ($bankCards as $bankCard) {
$records[] = [
'agreementNo' => $bankCard->agreement_no,
'cardUserName' => $bankCard->card_user_name,
'lastCardNo' => $bankCard->last_card_no,
'bankMobile' => $bankCard->bank_mobile,
'bankCode' => $bankCard->bank_code,
'bankName' => $bankCard->bank_name,
'cardType' => $bankCard->card_type,
'cnapsCode' => $bankCard->cnaps_code,
'publicFlag' => $bankCard->public_flag,
'repaymentDate' => $bankCard->repayment_date,
'mainFlag' => $bankCard->main_flag,
'status' => $bankCard->status,
'avaFlag' => $bankCard->ava_flag,
'remark' => $bankCard->remark,
];
}
return $records;
}
public function saveBankCard(array $data, User $user)
{
$appId = $user->app_id;

@ -19,6 +19,7 @@ Router::addGroup('/payment',function () {
Router::post('/pwd-forget', [PaymentController::class, 'pwdForget']);
Router::post('/pwd-modify', [PaymentController::class, 'pwdModify']);
Router::post('/payment', [PaymentController::class, 'payment']);
Router::post('/query-bind-cards', [PaymentController::class, 'queryBindCards']);
Router::post('/refund-apply', [PaymentController::class, 'refundApply']);
Router::post('/refund-confirm', [PaymentController::class, 'refundConfirm']);
Router::post('/refund-cancel', [PaymentController::class, 'refundCancel']);

Loading…
Cancel
Save