src/PHPDish/Bundle/PaymentBundle/Service/WalletManager.php
public function approveWithdraw(WalletHistoryInterface $history, $reason = null)
    {
        $wallet = $history->getWallet();
        $wallet->setFreezeAmount(
            $wallet->getFreezeAmount() - $history->getAmount()
        ); //减去冻结的金额
        $history->setDescription(
            $history->getDescription() . "; " . $this->translator->trans('withdraw.approve_reason', [
                '%reason%' => $reason ?: $this->translator->trans('withdraw.no_reason')
            ])
        );
        $history->setStatus(PaymentInterface::STATUS_OK);
        $this->entityManager->persist($history);
        $this->entityManager->flush();
        //提现
        $this->eventDispatcher->dispatch(PaymentEvent::WITHDRAW_APPROVED, new PaymentEvent($history));
    }
public function approveWithdraw(WalletHistoryInterface $history, $reason = null)
    {
        $wallet = $history->getWallet();
        $wallet->setFreezeAmount(
            $wallet->getFreezeAmount() - $history->getAmount()
        ); //减去冻结的金额
        $history->setDescription(
            $history->getDescription() . "; " . $this->translator->trans('withdraw.approve_reason', [
                '%reason%' => $reason ?: $this->translator->trans('withdraw.no_reason')
            ])
        );
        $history->setStatus(PaymentInterface::STATUS_OK);
        $this->entityManager->persist($history);
        $this->entityManager->flush();
        //提现
        $this->eventDispatcher->dispatch(PaymentEvent::WITHDRAW_APPROVED, new PaymentEvent($history));
    }
{@inheritdoc}