ljl 1 year ago
parent a7056cf6be
commit a3cf428367

@ -75,6 +75,17 @@ class PaymentController extends AbstractController
return $this->success(['url' => $url]);
}
public function getBalance(RequestInterface $request)
{
[$app, $data, $token] = $this->parseReqest($request, UnbindCardRequest::class);
$user = User::where('app_id', $app->app_id)->where('user_id', $data['userId'])->first();
if (empty($user)) {
throw new BusinessException('用户不存在');
}
$result = $this->userService->getBalance($user->member_id);
return $this->success(['result' => $result]);
}
public function payment(RequestInterface $request) {
[$app, $data, $token] = $this->parseReqest($request, UnbindCardRequest::class);
$data = $this->paymentService->payment($data, $app, $token);

@ -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('/get-balance', [PaymentController::class, 'getBalance']);
Router::post('/confirm-pay', [PaymentController::class, 'confirmPay']);
Router::post('/query-order', [PaymentController::class, 'queryOrder']);
Router::post('/transfer-pay', [PaymentController::class, 'transferPay']);

Loading…
Cancel
Save