|
...
|
...
|
@@ -100,7 +100,7 @@ class TicketCount extends Command |
|
|
|
->where(function ($query) {
|
|
|
|
$query->where(function ($q) {
|
|
|
|
$q->whereNotNull('end_at')
|
|
|
|
->whereColumn('plan_end_at', '>', 'end_at');
|
|
|
|
->whereColumn('plan_end_at', '<', 'end_at');
|
|
|
|
})->orWhere(function ($q) {
|
|
|
|
$q->whereNull('end_at')
|
|
|
|
->where('plan_end_at', '>', now());
|
|
...
|
...
|
@@ -161,12 +161,12 @@ class TicketCount extends Command |
|
|
|
}
|
|
|
|
//超期工单数量
|
|
|
|
$timeout_num = $ticketLogModel
|
|
|
|
->where('engineer_id', $item['manage_id'])
|
|
|
|
->whereIn('engineer_id', $manageIdArr)
|
|
|
|
->where('is_engineer', 1)
|
|
|
|
->where(function ($query) {
|
|
|
|
$query->where(function ($q) {
|
|
|
|
$q->whereNotNull('end_at')
|
|
|
|
->whereColumn('plan_end_at', '>', 'end_at');
|
|
|
|
->whereColumn('plan_end_at', '<', 'end_at');
|
|
|
|
})->orWhere(function ($q) {
|
|
|
|
$q->whereNull('end_at')
|
|
|
|
->where('plan_end_at', '>', now());
|
|
...
|
...
|
@@ -227,7 +227,7 @@ class TicketCount extends Command |
|
|
|
->where(function ($query) {
|
|
|
|
$query->where(function ($q) {
|
|
|
|
$q->whereNotNull('end_at')
|
|
|
|
->whereColumn('plan_end_at', '>', 'end_at');
|
|
|
|
->whereColumn('plan_end_at', '<>>', 'end_at');
|
|
|
|
})->orWhere(function ($q) {
|
|
|
|
$q->whereNull('end_at')
|
|
|
|
->where('plan_end_at', '>', now());
|
...
|
...
|
|