|
...
|
...
|
@@ -173,14 +173,14 @@ class countProject extends Command |
|
|
|
->where('created_at','<=',$end_time)
|
|
|
|
->orderByRaw('diff ASC')
|
|
|
|
->first();
|
|
|
|
$data[$v]['min_project_count']['min_project_count'] = $min_info['diff'];
|
|
|
|
$data[$v]['min_project_count'] = $min_info['diff'];
|
|
|
|
$max_info = $projectModel->select('*')
|
|
|
|
->selectRaw('DATEDIFF(STR_TO_DATE(uptime, "%Y-%m-%d"), STR_TO_DATE(created_at, "%Y-%m-%d")) AS diff')
|
|
|
|
->whereNotNull('uptime') // 确保 uptime 字段不为空
|
|
|
|
->where('created_at','<=',$end_time)
|
|
|
|
->orderByRaw('diff DESC')
|
|
|
|
->first();
|
|
|
|
$data[$v]['min_project_count']['max_project_count'] = $max_info['diff'];
|
|
|
|
$data[$v]['min_project_count'] = $max_info['diff'];
|
|
|
|
$data[$v]['average'] = ceil(($max_info['diff'] + $min_info['diff']) / 2);
|
|
|
|
}
|
|
|
|
return $data;
|
...
|
...
|
|