feat(order): 增加比赛订单,免费退坑时间时自动确认收货功能
- 新增逻辑判断,检查订单是否关联了比赛 - 如果关联了比赛,设置自动确认收货时间为比赛结束时 - 保留原有自动确认收货功能,作为备选方案
This commit is contained in:
@@ -353,12 +353,21 @@ class Order
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加自动确认收货队列,这个队列只自动确认 本次发货的 items
|
//ZY比赛开始时自动确认收货。
|
||||||
$confirm_days = Config::getConfigField('shop.order.auto_confirm');
|
$join = GameJoin::get('order_id', $order->id);
|
||||||
$confirm_days = $confirm_days > 0 ? $confirm_days : 0;
|
if (!empty($join)) {
|
||||||
if ($confirm_days) {
|
$later = strtotime($join->quit_time) - time();
|
||||||
// 小于等于0, 不自动确认收货
|
if ($later > 0) {
|
||||||
\think\Queue::later(($confirm_days * 86400), '\addons\shopro\job\OrderAutoOper@autoConfirm', $params, 'shopro');
|
\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;
|
||||||
|
if ($confirm_days) {
|
||||||
|
// 小于等于0, 不自动确认收货
|
||||||
|
\think\Queue::later(($confirm_days * 86400), '\addons\shopro\job\OrderAutoOper@autoConfirm', $params, 'shopro');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user