|
...
|
...
|
@@ -94,7 +94,19 @@ class TicketCount extends Command |
|
|
|
$fastest_time = null;
|
|
|
|
}
|
|
|
|
//超时工单数量
|
|
|
|
$timeout_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'plan_end_at'=>['>',date('Y-m-d H:i:s')]]);
|
|
|
|
$timeout_num = $ticketLogModel
|
|
|
|
->where('engineer_id', $item['manage_id'])
|
|
|
|
->where('is_engineer', 1)
|
|
|
|
->where(function ($query) {
|
|
|
|
$query->where(function ($q) {
|
|
|
|
$q->whereNotNull('end_at')
|
|
|
|
->whereColumn('plan_end_at', '>', 'end_at');
|
|
|
|
})->orWhere(function ($q) {
|
|
|
|
$q->whereNull('end_at')
|
|
|
|
->where('plan_end_at', '>', now());
|
|
|
|
});
|
|
|
|
})
|
|
|
|
->count();
|
|
|
|
if(!empty($timeout_num)){
|
|
|
|
$timeout_ratio = round($timeout_num / $ticket_num, 3);
|
|
|
|
}
|
|
...
|
...
|
@@ -148,7 +160,19 @@ class TicketCount extends Command |
|
|
|
$average_time = round($timeCount / $ticket_num, 3);
|
|
|
|
}
|
|
|
|
//超期工单数量
|
|
|
|
$timeout_num = $ticketLogModel->counts(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1,'plan_end_at'=>['>',date('Y-m-d H:i:s')]]);
|
|
|
|
$timeout_num = $ticketLogModel
|
|
|
|
->where('engineer_id', $item['manage_id'])
|
|
|
|
->where('is_engineer', 1)
|
|
|
|
->where(function ($query) {
|
|
|
|
$query->where(function ($q) {
|
|
|
|
$q->whereNotNull('end_at')
|
|
|
|
->whereColumn('plan_end_at', '>', 'end_at');
|
|
|
|
})->orWhere(function ($q) {
|
|
|
|
$q->whereNull('end_at')
|
|
|
|
->where('plan_end_at', '>', now());
|
|
|
|
});
|
|
|
|
})
|
|
|
|
->count();
|
|
|
|
if(!empty($timeout_num)){
|
|
|
|
$timeout_ratio = round($timeout_num / $ticket_num, 3);
|
|
|
|
}
|
|
...
|
...
|
@@ -199,7 +223,17 @@ class TicketCount extends Command |
|
|
|
)
|
|
|
|
->groupBy('p.project_cate')
|
|
|
|
->pluck('ticket_count', 'project_cate');
|
|
|
|
$timeout_num = $ticketModel->counts(['plan_end_at'=>['>',date('Y-m-d H:i:s')]]);
|
|
|
|
$timeout_num = $ticketModel
|
|
|
|
->where(function ($query) {
|
|
|
|
$query->where(function ($q) {
|
|
|
|
$q->whereNotNull('end_at')
|
|
|
|
->whereColumn('plan_end_at', '>', 'end_at');
|
|
|
|
})->orWhere(function ($q) {
|
|
|
|
$q->whereNull('end_at')
|
|
|
|
->where('plan_end_at', '>', now());
|
|
|
|
});
|
|
|
|
})
|
|
|
|
->count();
|
|
|
|
$timeout_ratio = null;
|
|
|
|
if(!empty($timeout_num)){
|
|
|
|
$timeout_ratio = round($timeout_num / $ticket_num, 3);
|
...
|
...
|
|