mirror of
https://gitee.com/liuxioabin/fengketrade.git
synced 2026-04-17 21:03:17 +08:00
日志
This commit is contained in:
parent
8c62ee49f7
commit
82d0bcd09d
@ -274,19 +274,57 @@ class Withdraw
|
|||||||
{
|
{
|
||||||
// 检查提现打款时间限制(小时)- 每次都重新读取配置确保最新
|
// 检查提现打款时间限制(小时)- 每次都重新读取配置确保最新
|
||||||
$freshConfig = sheep_config('shop.recharge_withdraw.withdraw', false);
|
$freshConfig = sheep_config('shop.recharge_withdraw.withdraw', false);
|
||||||
|
|
||||||
|
// 调试日志:记录配置读取情况
|
||||||
|
\think\Log::write('提现时间限制检查 - 读取的配置: ' . json_encode($freshConfig, JSON_UNESCAPED_UNICODE), 'info');
|
||||||
|
\think\Log::write('提现时间限制检查 - 配置类型: ' . gettype($freshConfig), 'info');
|
||||||
|
|
||||||
$limitHours = 0;
|
$limitHours = 0;
|
||||||
if (is_array($freshConfig) && isset($freshConfig['days_7'])) {
|
if (is_array($freshConfig)) {
|
||||||
$limitHours = intval($freshConfig['days_7']);
|
// 尝试多种可能的字段名
|
||||||
$this->config['days_7'] = $limitHours; // 更新实例配置
|
if (isset($freshConfig['days_7'])) {
|
||||||
} elseif (isset($this->config['days_7'])) {
|
$limitHours = intval($freshConfig['days_7']);
|
||||||
$limitHours = intval($this->config['days_7']);
|
$this->config['days_7'] = $limitHours;
|
||||||
|
\think\Log::write('提现时间限制检查 - 从days_7读取到: ' . $limitHours, 'info');
|
||||||
|
} elseif (isset($freshConfig['withdraw_limit_hours'])) {
|
||||||
|
$limitHours = intval($freshConfig['withdraw_limit_hours']);
|
||||||
|
$this->config['days_7'] = $limitHours;
|
||||||
|
\think\Log::write('提现时间限制检查 - 从withdraw_limit_hours读取到: ' . $limitHours, 'info');
|
||||||
|
} else {
|
||||||
|
// 打印所有配置键,帮助调试
|
||||||
|
\think\Log::write('提现时间限制检查 - 配置中的所有键: ' . implode(', ', array_keys($freshConfig)), 'info');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
\think\Log::write('提现时间限制检查 - 警告: 配置不是数组类型', 'warning');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果还是没有读取到,尝试从实例配置中读取
|
||||||
|
if ($limitHours == 0 && isset($this->config['days_7'])) {
|
||||||
|
$limitHours = intval($this->config['days_7']);
|
||||||
|
\think\Log::write('提现时间限制检查 - 从实例配置读取到: ' . $limitHours, 'info');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果还是0,尝试直接读取配置字段
|
||||||
|
if ($limitHours == 0) {
|
||||||
|
$directConfig = \app\admin\model\shopro\Config::getConfigField('shop.recharge_withdraw.withdraw.days_7', false);
|
||||||
|
if ($directConfig !== null) {
|
||||||
|
$limitHours = intval($directConfig);
|
||||||
|
\think\Log::write('提现时间限制检查 - 直接读取配置字段: ' . $limitHours, 'info');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调试日志:记录最终的限制小时数
|
||||||
|
\think\Log::write('提现时间限制检查 - 最终限制小时数: ' . $limitHours, 'info');
|
||||||
|
|
||||||
// 如果配置了时间限制,检查是否满足条件
|
// 如果配置了时间限制,检查是否满足条件
|
||||||
if ($limitHours > 0) {
|
if ($limitHours > 0) {
|
||||||
$createtime = intval($withdraw->createtime);
|
$createtime = intval($withdraw->createtime);
|
||||||
if ($createtime > 0) {
|
if ($createtime > 0) {
|
||||||
$hoursDiff = (time() - $createtime) / 3600; // 3600秒 = 1小时
|
$hoursDiff = (time() - $createtime) / 3600; // 3600秒 = 1小时
|
||||||
|
|
||||||
|
// 调试日志:记录时间差
|
||||||
|
\think\Log::write('提现时间限制检查 - 申请时间: ' . date('Y-m-d H:i:s', $createtime) . ', 当前时间: ' . date('Y-m-d H:i:s', time()) . ', 时间差(小时): ' . $hoursDiff, 'info');
|
||||||
|
|
||||||
if ($hoursDiff < $limitHours) {
|
if ($hoursDiff < $limitHours) {
|
||||||
$remainingHours = ceil($limitHours - $hoursDiff);
|
$remainingHours = ceil($limitHours - $hoursDiff);
|
||||||
$remainingDays = floor($remainingHours / 24);
|
$remainingDays = floor($remainingHours / 24);
|
||||||
@ -301,9 +339,16 @@ class Withdraw
|
|||||||
if (empty($timeText)) {
|
if (empty($timeText)) {
|
||||||
$timeText = '1小时';
|
$timeText = '1小时';
|
||||||
}
|
}
|
||||||
|
\think\Log::write('提现时间限制检查 - 时间限制检查失败,抛出异常', 'info');
|
||||||
throw new ShoproException('提现申请时间未超过' . $limitHours . '小时,还需等待' . $timeText . '才能放款');
|
throw new ShoproException('提现申请时间未超过' . $limitHours . '小时,还需等待' . $timeText . '才能放款');
|
||||||
|
} else {
|
||||||
|
\think\Log::write('提现时间限制检查 - 时间限制检查通过', 'info');
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
\think\Log::write('提现时间限制检查 - 警告: 提现记录的创建时间为空或无效', 'warning');
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
\think\Log::write('提现时间限制检查 - 未配置时间限制或限制为0,跳过检查', 'info');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user