This commit is contained in:
Billy 2025-11-20 18:58:18 +08:00
parent 313061e30b
commit b7ded5d703

View File

@ -201,9 +201,10 @@ class Withdraw
Db::commit(); Db::commit();
} catch (ShoproException $e) { } catch (ShoproException $e) {
Db::commit(); // 不回滚,记录错误日志 Db::rollback(); // 回滚事务因为7天限制等原因导致打款失败
throw new ShoproException($e->getMessage()); throw new ShoproException($e->getMessage());
} catch (HttpResponseException $e) { } catch (HttpResponseException $e) {
Db::rollback();
$data = $e->getResponse()->getData(); $data = $e->getResponse()->getData();
$message = $data ? ($data['msg'] ?? '') : $e->getMessage(); $message = $data ? ($data['msg'] ?? '') : $e->getMessage();
throw new ShoproException($message); throw new ShoproException($message);
@ -235,7 +236,8 @@ class Withdraw
} }
// 检查7天限制 // 检查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); $createtime = intval($withdraw->createtime);
if ($createtime > 0) { if ($createtime > 0) {
$daysDiff = (time() - $createtime) / 86400; // 86400秒 = 1天 $daysDiff = (time() - $createtime) / 86400; // 86400秒 = 1天