can('dcat.admin.dealer_wallet_to_bank_logs.verify'); } /** * Handle the form request. * * @param array $input * * @return mixed */ public function handle(array $input) { $id = $this->payload['id'] ?? 0; try { DB::beginTransaction(); $log = DealerWalletToBankLog::lockForUpdate()->findOrFail($id); if (! in_array($log->status, [DealerWalletToBankLogStatus::Pending, DealerWalletToBankLogStatus::Failed])) { throw new BizException('提现记录状态异常'); } $log->pay_info = $log->user->dealer->pay_info; $log->pay_image = $input['pay_image'] ?? null; $log->pay_way = DealerWalletToBankLogPayWay::Offline; $log->pay_at = now(); $log->status = DealerWalletToBankLogStatus::Success; $log->save(); DB::commit(); } catch (Throwable $th) { DB::rollBack(); report($th); return $this->response()->error('操作失败:'.$th->getMessage()); } return $this->response() ->success(__('admin.update_succeeded')) ->refresh(); } /** * Build a form here. */ public function form() { $this->image('pay_image') ->move('dealer-pay/'.Carbon::now()->toDateString()) ->saveFullUrl() ->removable(false) ->autoUpload(); } }