diff --git a/app/Admin/Forms/WalletToBankLogVerify.php b/app/Admin/Forms/WalletToBankLogVerify.php index 4db1ea7f..6a2d3431 100644 --- a/app/Admin/Forms/WalletToBankLogVerify.php +++ b/app/Admin/Forms/WalletToBankLogVerify.php @@ -2,7 +2,9 @@ namespace App\Admin\Forms; +use App\Models\WalletLog; use App\Models\WalletToBankLog; +use App\Services\WalletService; use Dcat\Admin\Contracts\LazyRenderable; use Dcat\Admin\Traits\LazyWidget; use Dcat\Admin\Widgets\Form; @@ -37,6 +39,12 @@ class WalletToBankLogVerify extends Form implements LazyRenderable try { DB::beginTransaction(); $log->update($input); + //如果拒绝,重新添加对应可提金额 + if ($log->status == 2) { + $walletService = new WalletService(); + $walletService->changeBalance($log->user, $log->amount, WalletLog::ACTION_WITHDRAW_FAILED, '提现-失败', $log); + } + DB::commit(); } catch (Throwable $th) { DB::rollBack(); @@ -63,6 +71,9 @@ class WalletToBankLogVerify extends Form implements LazyRenderable $this->text('username')->value($log->username)->disable(); $this->text('bank_description')->value($log->bank_description)->disable(); $this->currency('amount')->symbol('¥')->value(bcdiv($log->amount, 100, 2))->disable(); + $this->rate('rate')->value($log->rate)->disable(); + $this->currency('service_amount')->symbol('¥')->value(bcdiv($log->service_amount, 100, 2))->disable(); + $this->currency('account_amount')->symbol('¥')->value(bcdiv($log->account_amount, 100, 2))->disable(); $this->radio('status')->options([ 1 => '成功', diff --git a/app/Models/WalletLog.php b/app/Models/WalletLog.php index 4375659b..52faee21 100644 --- a/app/Models/WalletLog.php +++ b/app/Models/WalletLog.php @@ -14,6 +14,7 @@ class WalletLog extends Model public const ACTION_ORDER_AFTER_SALE = 3; public const ACTION_WITHDRAW_BANK = 4; public const ACTION_WITHDRAW_BALACNE = 5; + public const ACTION_WITHDRAW_FAILED = 6; /** * @var array diff --git a/resources/lang/zh_CN/wallet-to-bank-log.php b/resources/lang/zh_CN/wallet-to-bank-log.php index 8be77bee..c98af7bb 100644 --- a/resources/lang/zh_CN/wallet-to-bank-log.php +++ b/resources/lang/zh_CN/wallet-to-bank-log.php @@ -11,6 +11,7 @@ return [ 'bank_description' => '收款银行开户行', 'username' => '持卡人', 'amount' => '提现金额', + 'rate' => '费率', 'service_amount' => '手续费', 'account_amount' => '到账金额', 'status' => '状态',