From 8c62ee49f7e4d3b22ef359e0f84609ddfdfea582 Mon Sep 17 00:00:00 2001 From: Billy <641833868@qq.com> Date: Thu, 20 Nov 2025 19:22:27 +0800 Subject: [PATCH] up --- addons/shopro/service/Withdraw.php | 21 ++++++++++++------- .../admin/controller/shopro/Withdraw.php | 2 ++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/addons/shopro/service/Withdraw.php b/addons/shopro/service/Withdraw.php index 3c8b5d5..6d93d81 100755 --- a/addons/shopro/service/Withdraw.php +++ b/addons/shopro/service/Withdraw.php @@ -269,14 +269,9 @@ class Withdraw return $this->handleLog($withdraw, '同意提现申请', $oper); } - // 处理打款 - public function handleWithdraw($withdraw, $oper = null) + // 检查提现打款时间限制(公共方法,可在打款前调用) + public function checkWithdrawTimeLimit($withdraw) { - $withDrawStatus = false; - if ($withdraw->status != 1) { - throw new ShoproException('请勿重复操作'); - } - // 检查提现打款时间限制(小时)- 每次都重新读取配置确保最新 $freshConfig = sheep_config('shop.recharge_withdraw.withdraw', false); $limitHours = 0; @@ -310,6 +305,18 @@ class Withdraw } } } + } + + // 处理打款 + public function handleWithdraw($withdraw, $oper = null) + { + $withDrawStatus = false; + if ($withdraw->status != 1) { + throw new ShoproException('请勿重复操作'); + } + + // 检查提现打款时间限制 + $this->checkWithdrawTimeLimit($withdraw); if ($withdraw->withdraw_type !== 'bank') { $withDrawStatus = $this->handleTransfer($withdraw); diff --git a/application/admin/controller/shopro/Withdraw.php b/application/admin/controller/shopro/Withdraw.php index d760880..0d9a95e 100644 --- a/application/admin/controller/shopro/Withdraw.php +++ b/application/admin/controller/shopro/Withdraw.php @@ -106,6 +106,8 @@ class Withdraw extends Common $withdraw = $withdrawLib->handleWithdraw($withdraw); break; case 'agree&withdraw': + // 先检查时间限制,再执行同意和打款操作 + $withdrawLib->checkWithdrawTimeLimit($withdraw); $withdraw = $withdrawLib->handleAgree($withdraw); $withdraw = $withdrawLib->handleWithdraw($withdraw); break;