修复 单独发给模块时的情况
This commit is contained in:
parent
b54d923efe
commit
4856073401
@ -38,10 +38,13 @@ public function handle()
|
|||||||
WorkOrder::whereIn('status', ['pending', 'error'])->with(['module', 'user', 'host', 'replies'])->chunk(100, function ($workOrders) {
|
WorkOrder::whereIn('status', ['pending', 'error'])->with(['module', 'user', 'host', 'replies'])->chunk(100, function ($workOrders) {
|
||||||
foreach ($workOrders as $workOrder) {
|
foreach ($workOrders as $workOrder) {
|
||||||
|
|
||||||
if ($workOrder->host->status === 'pending') {
|
if ($workOrder->host) {
|
||||||
continue;
|
if ($workOrder->host->status === 'pending') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($workOrder->status === 'error') {
|
if ($workOrder->status === 'error') {
|
||||||
// 如果 created_at 超过 3 天 use Carbon
|
// 如果 created_at 超过 3 天 use Carbon
|
||||||
if (now()->diffInDays($workOrder->created_at) > 3) {
|
if (now()->diffInDays($workOrder->created_at) > 3) {
|
||||||
|
Loading…
Reference in New Issue
Block a user