|
...
|
...
|
@@ -195,10 +195,18 @@ class countProject extends Command |
|
|
|
$data['create_web_count'] = $projectModel->count(['type'=>2,'deleted_at'=>0]);//建站项目总数
|
|
|
|
$data['no_go_oline_count'] = $projectModel->count(['uptime'=>null,'deleted_at'=>0]);//未上线项目数量
|
|
|
|
$data['delete_project_count'] = $projectModel->count(['deleted_at'=>1]);//删除项目数量
|
|
|
|
$min_info = $projectModel->select('*')->selectRaw('(uptime - created_at) as diff')->where('uptime','!=',null)->orderByRaw('diff ASC')->first();
|
|
|
|
$min_info = $projectModel->select('*')
|
|
|
|
->selectRaw('DATEDIFF(STR_TO_DATE(uptime, "%Y-%m-%d"), STR_TO_DATE(created_at, "%Y-%m-%d")) AS days_diff')
|
|
|
|
->whereNotNull('uptime') // 确保 uptime 字段不为空
|
|
|
|
->orderByRaw('diff ASC')
|
|
|
|
->first();
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($min_info, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$data['min_project_count'] = $min_info['diff'];
|
|
|
|
$max_info = $projectModel->select('*')->selectRaw('(uptime - created_at) as diff')->where('uptime','!=',null)->orderByRaw('diff Desc')->first();
|
|
|
|
$max_info = $projectModel->select('*')
|
|
|
|
->selectRaw('DATEDIFF(STR_TO_DATE(uptime, "%Y-%m-%d"), STR_TO_DATE(created_at, "%Y-%m-%d")) AS days_diff')
|
|
|
|
->whereNotNull('uptime') // 确保 uptime 字段不为空
|
|
|
|
->orderByRaw('diff DESC')
|
|
|
|
->first();
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($max_info, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$data['max_project_count'] = $max_info['diff'];
|
|
|
|
$data['average'] = ceil(($max_info['diff'] + $min_info['diff']) / 2);
|
...
|
...
|
|