feat(order): 增加比赛订单,免费退坑时间时自动确认收货功能

- 新增逻辑判断,检查订单是否关联了比赛
- 如果关联了比赛,设置自动确认收货时间为比赛结束时
- 保留原有自动确认收货功能,作为备选方案
This commit is contained in:
2025-06-01 17:34:34 +08:00
parent 8fe0a460cd
commit 3feb90619c

View File

@@ -353,6 +353,14 @@ class Order
}
}
//ZY比赛开始时自动确认收货。
$join = GameJoin::get('order_id', $order->id);
if (!empty($join)) {
$later = strtotime($join->quit_time) - time();
if ($later > 0) {
\think\Queue::later(($later), '\addons\shopro\job\OrderAutoOper@autoConfirm', $params, 'shopro');
}
} else {
// 添加自动确认收货队列,这个队列只自动确认 本次发货的 items
$confirm_days = Config::getConfigField('shop.order.auto_confirm');
$confirm_days = $confirm_days > 0 ? $confirm_days : 0;
@@ -361,6 +369,7 @@ class Order
\think\Queue::later(($confirm_days * 86400), '\addons\shopro\job\OrderAutoOper@autoConfirm', $params, 'shopro');
}
}
}
$user = User::where('id', $order['user_id'])->find();
$user && $user->notify(