From 447d9eb1ad34c8f2cb38654793e00efd9e0f85f8 Mon Sep 17 00:00:00 2001 From: elf <360197197@qq.com> Date: Tue, 19 Sep 2023 23:36:17 +0800 Subject: [PATCH] yh --- app/Command/MineCommand.php | 11 +++++++++++ app/Service/PaymentService.php | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/Command/MineCommand.php b/app/Command/MineCommand.php index 0c2f376..dad5539 100644 --- a/app/Command/MineCommand.php +++ b/app/Command/MineCommand.php @@ -46,6 +46,8 @@ class MineCommand extends HyperfCommand public function handle(): void { + $this->unbindWithdrawEntrust(); + return; $this->getBalance(); $this->getRequestData(); return; @@ -529,4 +531,13 @@ class MineCommand extends HyperfCommand ]; $baofu->transferWithdraw($data); } + + protected function unbindWithdrawEntrust($userId = 'ELF1990') { + /** + * @var UserService $userService + */ + $userService = $this->container->make(UserService::class); + $url = $userService->unbindWithdrawEntrust(['userId' => $userId], $this->getApp(), $this->getToken()); + echo $url; + } } \ No newline at end of file diff --git a/app/Service/PaymentService.php b/app/Service/PaymentService.php index aaef169..b949504 100644 --- a/app/Service/PaymentService.php +++ b/app/Service/PaymentService.php @@ -633,13 +633,13 @@ class PaymentService extends AbstractService $withdraw->save(); if ($withdrawType == 'entrust') { - return $this->doEntrustWithdraw($data, $withdraw); + return $this->doEntrustWithdraw($data, $withdraw, $token); } else { - return $this->doWithdraw($data, $withdraw); + return $this->doWithdraw($data, $withdraw, $token); } } - private function doWithdraw(array $data, Withdraw $withdraw) { + private function doWithdraw(array $data, Withdraw $withdraw, string $token) { try { $baofu = new Baofu(); $result = $baofu->withdraw([ @@ -662,7 +662,7 @@ class PaymentService extends AbstractService } } - private function doEntrustWithdraw(array $data, Withdraw $withdraw) { + private function doEntrustWithdraw(array $data, Withdraw $withdraw, string $token) { try { $baofu = new Baofu(); $result = $baofu->entrustWithdraw([