This commit is contained in:
Billy 2025-11-20 19:50:01 +08:00
parent 82d0bcd09d
commit 2704e1610d
2 changed files with 13 additions and 4 deletions

View File

@ -76,6 +76,7 @@ class Withdraw
$withdraw->withdraw_info = $withdrawInfo;
$withdraw->status = 0;
$withdraw->platform = request()->header('platform');
$withdraw->createtime = time(); // 显式设置创建时间
$withdraw->save();
// 佣金钱包变动
@ -214,7 +215,10 @@ class Withdraw
// 如果配置了时间限制,先检查是否满足条件
if ($limitHours > 0) {
$createtime = intval($withdraw->createtime);
// 直接从数据库获取创建时间,避免模型获取器转换
$createtime = WithdrawModel::where('id', $withdraw->id)->value('createtime');
$createtime = $createtime ? intval($createtime) : 0;
if ($createtime > 0) {
$hoursDiff = (time() - $createtime) / 3600; // 3600秒 = 1小时
if ($hoursDiff < $limitHours) {
@ -318,12 +322,15 @@ class Withdraw
// 如果配置了时间限制,检查是否满足条件
if ($limitHours > 0) {
$createtime = intval($withdraw->createtime);
// 直接从数据库获取创建时间,避免模型获取器转换
$createtime = WithdrawModel::where('id', $withdraw->id)->value('createtime');
$createtime = $createtime ? intval($createtime) : 0;
if ($createtime > 0) {
$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');
\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);

View File

@ -100,9 +100,11 @@ class Withdraw extends Common
switch ($action) {
case 'agree':
$withdrawLib->checkWithdrawTimeLimit($withdraw);
$withdraw = $withdrawLib->handleAgree($withdraw);
break;
case 'withdraw':
$withdrawLib->checkWithdrawTimeLimit($withdraw);
$withdraw = $withdrawLib->handleWithdraw($withdraw);
break;
case 'agree&withdraw':