diff --git a/addons/shopro/service/Withdraw.php b/addons/shopro/service/Withdraw.php index c37e9b0..514b6cd 100755 --- a/addons/shopro/service/Withdraw.php +++ b/addons/shopro/service/Withdraw.php @@ -279,33 +279,20 @@ class Withdraw // 检查提现打款时间限制(小时)- 每次都重新读取配置确保最新 $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; if (is_array($freshConfig)) { - // 尝试多种可能的字段名 if (isset($freshConfig['days_7'])) { $limitHours = intval($freshConfig['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,尝试直接读取配置字段 @@ -313,13 +300,9 @@ class Withdraw $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) { // 直接从数据库获取创建时间,避免模型获取器转换 @@ -329,9 +312,6 @@ class Withdraw if ($createtime > 0) { $hoursDiff = (time() - $createtime) / 3600; // 3600秒 = 1小时 - // 调试日志:记录时间差 - \think\Log::write('提现时间限制检查 - 提现ID: ' . $withdraw->id . ', 申请时间: ' . date('Y-m-d H:i:s', $createtime) . ' (时间戳: ' . $createtime . '), 当前时间: ' . date('Y-m-d H:i:s', time()) . ' (时间戳: ' . time() . '), 时间差(小时): ' . $hoursDiff, 'info'); - if ($hoursDiff < $limitHours) { $remainingHours = ceil($limitHours - $hoursDiff); $remainingDays = floor($remainingHours / 24); @@ -346,16 +326,9 @@ class Withdraw if (empty($timeText)) { $timeText = '1小时'; } - \think\Log::write('提现时间限制检查 - 时间限制检查失败,抛出异常', 'info'); throw new ShoproException('提现申请时间未超过' . $limitHours . '小时,还需等待' . $timeText . '才能放款'); - } else { - \think\Log::write('提现时间限制检查 - 时间限制检查通过', 'info'); } - } else { - \think\Log::write('提现时间限制检查 - 警告: 提现记录的创建时间为空或无效', 'warning'); } - } else { - \think\Log::write('提现时间限制检查 - 未配置时间限制或限制为0,跳过检查', 'info'); } }