elf 1 year ago
parent f082399caf
commit 447d9eb1ad

@ -46,6 +46,8 @@ class MineCommand extends HyperfCommand
public function handle(): void public function handle(): void
{ {
$this->unbindWithdrawEntrust();
return;
$this->getBalance(); $this->getBalance();
$this->getRequestData(); $this->getRequestData();
return; return;
@ -529,4 +531,13 @@ class MineCommand extends HyperfCommand
]; ];
$baofu->transferWithdraw($data); $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;
}
} }

@ -633,13 +633,13 @@ class PaymentService extends AbstractService
$withdraw->save(); $withdraw->save();
if ($withdrawType == 'entrust') { if ($withdrawType == 'entrust') {
return $this->doEntrustWithdraw($data, $withdraw); return $this->doEntrustWithdraw($data, $withdraw, $token);
} else { } 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 { try {
$baofu = new Baofu(); $baofu = new Baofu();
$result = $baofu->withdraw([ $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 { try {
$baofu = new Baofu(); $baofu = new Baofu();
$result = $baofu->entrustWithdraw([ $result = $baofu->entrustWithdraw([

Loading…
Cancel
Save