From 7d8765e9773d54b57aa5f7f2dc4b62f77a335ed7 Mon Sep 17 00:00:00 2001 From: ljl Date: Tue, 15 Aug 2023 11:56:21 +0800 Subject: [PATCH] yh --- app/Controller/Payment/PaymentController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Controller/Payment/PaymentController.php b/app/Controller/Payment/PaymentController.php index ca12b41..b2e1ea7 100644 --- a/app/Controller/Payment/PaymentController.php +++ b/app/Controller/Payment/PaymentController.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace App\Controller\Payment; +use App\Exception\BusinessException; +use App\Model\User; use App\Request\BindCardRequest; use App\Request\RegisterRequest; use App\Request\UnbindCardRequest; @@ -103,7 +105,11 @@ class PaymentController extends AbstractController public function queryBindCards(RequestInterface $request) { [$app, $data, $token] = $this->parseReqest($request, UnbindCardRequest::class); - $this->userService->rsyncBankCards($data['userId']); + $user = User::where('app_id', $app->app_id)->where('user_id', $data['userId'])->first(); + if (empty($user)) { + throw new BusinessException('用户不存在'); + } + $this->userService->rsyncBankCards($user->member_id); $records = $this->userService->getUserBankCards($data['userId'], $app); return $this->success(['result' => $records]); }