mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
fix: 报表导出任务没有流程日志判断优化
This commit is contained in:
parent
6ba4170f08
commit
4d59cd1521
@ -1055,10 +1055,10 @@ class ProjectController extends AbstractController
|
||||
} else {
|
||||
$endSurplus = '-';
|
||||
}
|
||||
$developFlowChanges = ProjectTaskFlowChange::whereTaskId($task->id)->get();
|
||||
$flowChanges = ProjectTaskFlowChange::whereTaskId($task->id)->get();
|
||||
$developTime = 0;//开发时间
|
||||
$testTime = 0;//验收/测试时间
|
||||
foreach ($developFlowChanges as $change) {
|
||||
foreach ($flowChanges as $change) {
|
||||
if (strpos($change->before_flow_item_name, 'end') === false) {
|
||||
$upOne = ProjectTaskFlowChange::where('id', '<', $change->id)->whereTaskId($task->id)->orderByDesc('id')->first();
|
||||
if ($upOne) {
|
||||
@ -1092,6 +1092,10 @@ class ProjectController extends AbstractController
|
||||
$firstDevTime = Carbon::parse($firstChange->created_at)->timestamp - Carbon::parse($task->created_at)->timestamp;
|
||||
$developTime += $firstDevTime;
|
||||
}
|
||||
if (count($flowChanges) === 0) {
|
||||
$lastTime = $task->complete_at ? Carbon::parse($task->complete_at)->timestamp : time();
|
||||
$developTime = $lastTime - Carbon::parse($task->created_at)->timestamp;
|
||||
}
|
||||
$totalTime = $developTime + $testTime; //任务总用时
|
||||
$planTime = '-';//任务计划用时
|
||||
$overTime = '-';//超时时间
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user