From b7ded5d7033424e0c7fa5f6c2ed6652d7d7bfe04 Mon Sep 17 00:00:00 2001 From: Billy <641833868@qq.com> Date: Thu, 20 Nov 2025 18:58:18 +0800 Subject: [PATCH] up --- addons/shopro/service/Withdraw.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/shopro/service/Withdraw.php b/addons/shopro/service/Withdraw.php index 6251ad8..a7a7afd 100755 --- a/addons/shopro/service/Withdraw.php +++ b/addons/shopro/service/Withdraw.php @@ -201,9 +201,10 @@ class Withdraw Db::commit(); } catch (ShoproException $e) { - Db::commit(); // 不回滚,记录错误日志 + Db::rollback(); // 回滚事务,因为7天限制等原因导致打款失败 throw new ShoproException($e->getMessage()); } catch (HttpResponseException $e) { + Db::rollback(); $data = $e->getResponse()->getData(); $message = $data ? ($data['msg'] ?? '') : $e->getMessage(); throw new ShoproException($message); @@ -235,7 +236,8 @@ class Withdraw } // 检查7天限制 - if (isset($this->config['days_7']) && intval($this->config['days_7']) == 1) { + $days7Enabled = isset($this->config['days_7']) && (intval($this->config['days_7']) == 1 || $this->config['days_7'] === '1' || $this->config['days_7'] === true); + if ($days7Enabled) { $createtime = intval($withdraw->createtime); if ($createtime > 0) { $daysDiff = (time() - $createtime) / 86400; // 86400秒 = 1天