src/PHPDish/Bundle/AdminBundle/Controller/PaymentController.php
public function withdrawAction($id)
    {
        $form = $this->createForm(WithdrawType::class);
        $history = $this->admin->getSubject();
        $request = $this->getRequest();
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $translator = $this->get('translator');
            $walletManager = $this->getWalletManager();
            $action = $form->getData()['action'];
            $note = $form->getData()['note'];
            if ($action === 'approve') {
                $walletManager->approveWithdraw($history, $note);
                $this->addFlash('sonata_flash_success', $translator->trans('payment.withdraw_approve'));
            } else {
                $walletManager->refuseWithdraw($history, $note);
                $this->addFlash('sonata_flash_success', $translator->trans('payment.withdraw_declined'));
            }
            return $this->redirect($this->admin->generateUrl('list', ['filter' => $this->admin->getFilterParameters()]));
        }
        $formView = $form->createView();
        return $this->renderWithExtraParams('PHPDishAdminBundle:Payment:handle_withdraw.html.twig', [
            'action' => 'withdraw',
            'form' => $formView,
            'history' => $history
        ], null);
    }
public function withdrawAction($id)
    {
        $form = $this->createForm(WithdrawType::class);
        $history = $this->admin->getSubject();
        $request = $this->getRequest();
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $translator = $this->get('translator');
            $walletManager = $this->getWalletManager();
            $action = $form->getData()['action'];
            $note = $form->getData()['note'];
            if ($action === 'approve') {
                $walletManager->approveWithdraw($history, $note);
                $this->addFlash('sonata_flash_success', $translator->trans('payment.withdraw_approve'));
            } else {
                $walletManager->refuseWithdraw($history, $note);
                $this->addFlash('sonata_flash_success', $translator->trans('payment.withdraw_declined'));
            }
            return $this->redirect($this->admin->generateUrl('list', ['filter' => $this->admin->getFilterParameters()]));
        }
        $formView = $form->createView();
        return $this->renderWithExtraParams('PHPDishAdminBundle:Payment:handle_withdraw.html.twig', [
            'action' => 'withdraw',
            'form' => $formView,
            'history' => $history
        ], null);
    }
处理提现
@param int $id
@return \Symfony\Component\HttpFoundation\Response